i need an item to only work with custom values

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Thirantos

Member
Jul 17, 2019
1
0
0
I am new to script and I tried to make a custom chestplate but I have no idea how to do this.

I still need the normal leather chestplate available but I don't know how to do that.

this is the code I have but it doesn't work

Code:
on inventory close:
    send "&c&l[DEBUG, %player%]&f&l inventory close detected" to console
    player's gamemode is survival
    player is wearing leather tunic with the data value 5:
        send "&c&l[DEBUG, %player%]&f&l chestplate detected" to console
        allow flight to event-player
    player's gamemode is survival
    player is not wearing leather tunic with the data value 5:
        disallow flight to event-player
        send "&c&l[DEBUG, %player%]&f&l no chestplate" to console

reload errors

Code:
[15:58:41 ERROR]: [Skript] Can't compare a player with 'wearing leather tunic with the data value 5' (chestplate of air.sk, line 4: player is wearing leather tunic with the data value 5:')
[15:58:41 ERROR]: [Skript] Can't compare a player with 'wearing leather tunic with the data value 5' (chestplate of air.sk, line 8: player is not wearing leather tunic with the data value 5:')

I've tried searching the docs but not the forms
 
Last edited:
How about a custom name on it? You can check for a custom name, and then do your custom actions if it has been detected.

Code:
if player is wearing a leather chestplate named "&4Custom Chestplate":
    # do something
Just make sure it has a color in the name, otherwise, players may be able to obtain such chestplates with an anvil.
 
Status
Not open for further replies.