Solved Detect items specificity in a GUI

  • 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 comminuty!

    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.

Aralwen

Active Member
May 26, 2017
164
14
18
25
Hello,
I am looking for a way to detect an item without having to put several times a format gui.

Example :

code_language.skript:
command /gui:
    trigger:
        open virtual chest with 4 rows named "Gui" to player
        if {test} is true:
            set {_Dye} to green
        if {test} is false or not set:
            set {_Dye} to gray
        format gui slot 0 of player with %{_Dye}% dye named "%{test}%" to run using "left" click:

I also tried to put the color in quotation marks, nothing works
Thank's !
 
okay first of all. I would add "dye" to your green/gray, and then change your item in the gui to just be the variable, also I changed the second if statement to just be else... basically its saying (if test is true, else its false or not set) i tested it and it works
code_language.skript:
command /gui:
    trigger:
        open virtual chest with 4 rows named "Gui" to player
        if {test} is true:
            set {_Dye} to green dye
        else:
            set {_Dye} to gray dye
        format gui slot 0 of player with {_dye} named "%{test}%" to run using "left" click:
 
okay first of all. I would add "dye" to your green/gray, and then change your item in the gui to just be the variable, also I changed the second if statement to just be else... basically its saying (if test is true, else its false or not set) i tested it and it works
code_language.skript:
command /gui:
    trigger:
        open virtual chest with 4 rows named "Gui" to player
        if {test} is true:
            set {_Dye} to green dye
        else:
            set {_Dye} to gray dye
        format gui slot 0 of player with {_dye} named "%{test}%" to run using "left" click:

Decidedly, you are indispensable ! :emoji_sweat_smile:
Thanks so much for your involvement :emoji_relieved:

Solved
 
Status
Not open for further replies.