Run a command in the GUI with TuSke

  • 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.

SheewSpielt

Member
Jun 5, 2017
39
1
0
Hey dear SkUnity community,

I have written a script here with the add-on "TuSke".
At the end, I stated that the player should execute a command, but then clicking on the item in the GUI does not work. Can anybody help me with this?

Code:
command /kits [<text>]:
    trigger:
        if arg 1 is not set:
            open virtual chest inventory with 3 rows named "&4&l Such dir ein Kit aus" to player
            format gui slot 0 of player with gray stained glass pane named " " to close
            format gui slot 1 of player with gray stained glass pane named " " to close
            format gui slot 2 of player with gray stained glass pane named " " to close
            format gui slot 3 of player with gray stained glass pane named " " to close
            format gui slot 4 of player with gray stained glass pane named " " to close
            format gui slot 5 of player with gray stained glass pane named " " to close
            format gui slot 6 of player with gray stained glass pane named " " to close
            format gui slot 7 of player with gray stained glass pane named " " to close
            format gui slot 8 of player with gray stained glass pane named " " to close
            format gui slot 9 of player with gray stained glass pane named " " to close
            wait 4 ticks
            format gui slot 10 of player with glowing chainmail helmet of unbreaking 10 named "&7SPIELER-KIT" to close then run player command "/kits 1"
            format gui slot 11 of player with gray stained glass pane named " " to close
            wait 4 ticks
            format gui slot 12 of player with glowing iron helmet of unbreaking 10 named "&6PREMIUM-KIT" to close then run player command "/kits 2"
            format gui slot 13 of player with gray stained glass pane named " " to close
            wait 4 ticks
            format gui slot 14 of player with glowing diamond helmet of unbreaking 10 named "&5LEGENDEN-KIT" to close then run player command "/kits 3"
            format gui slot 15 of player with gray stained glass pane named " " to close
            wait 4 ticks
            format gui slot 16 of player with glowing golden helmet named "&cLUKAS-KIT" to close then run player command "/kits 4"
            format gui slot 17 of player with gray stained glass pane named " " to close
            format gui slot 18 of player with gray stained glass pane named " " to close
            format gui slot 19 of player with gray stained glass pane named " " to close
            format gui slot 20 of player with gray stained glass pane named " " to close
            format gui slot 21 of player with gray stained glass pane named " " to close
            format gui slot 22 of player with gray stained glass pane named " " to close
            format gui slot 23 of player with gray stained glass pane named " " to close
            format gui slot 24 of player with gray stained glass pane named " " to close
            format gui slot 25 of player with gray stained glass pane named " " to close
            format gui slot 26 of player with gray stained glass pane named " " to close
        if arg 1 is "1":
            clear the inventory of the player
            equip player with chainmail boots of unbreaking 1 with name "&7Schuhe &8<SPIELER-KIT>"
            equip player with chainmail leggings of unbreaking 1 with name "&7Hose &8<SPIELER-KIT>"
            equip player with chainmail chestplate of unbreaking 1 with name "&7Brustplate &8<SPIELER-KIT>"
            equip player with chainmail helmet of unbreaking 1 with name "&7Helm &8<SPIELER-KIT>"
            give player diamond axe with name "&7Axt &8<SPIELER-KIT>"
            loop 15 times:
                give player steak
            loop 16 times:
                give player ender pearl
            send "&7Du hast das &7<SPIELER-KIT> &7erhalten!"
        if arg 1 is "2":
            clear the inventory of the player
            equip player with chainmail boots of unbreaking 3 with name "&7&lSchuhe &6<PREMIUM-KIT>"
            equip player with chainmail leggings of unbreaking 3 with name "&7&lHose &6<PREMIUM-KIT>"
            equip player with chainmail chestplate of unbreaking 3 with name "&7&lBrustplate &6<PREMIUM-KIT>"
            equip player with chainmail helmet of unbreaking 3 with name "&7&lHelm &6<PREMIUM-KIT>"
            give player diamond sword of sharpness 1 with name "&5Sschwert &6<PREMIUM-KIT>"
            loop 15 times:
                give player steak
            loop 16 times:
                give player ender pearl
            loop 1 times:
                give player golden apple
            send "&7Du hast das &6&l<PREMIUM-KIT> &7erhalten!"
        if arg 1 is "3":
            clear the inventory of the player
            equip player with chainmail boots of unbreaking 5 with name "&7&lSchuhe &5LEGENDEN-KIT"
            equip player with chainmail leggings of unbreaking 5 with name "&7&lHose &5LEGENDEN-KIT"
            equip player with chainmail chestplate of unbreaking 5 with name "&7&lBrustplate &5LEGENDEN-KIT"
            equip player with chainmail helmet of unbreaking 5 with name "&7&lHelm &5LEGENDEN-KIT"
            give player diamond sword of sharpness 3 with name "&5Schwert &5LEGENDEN-KIT"
            loop 15 times:
                give player steak
            loop 16 times:
                give player ender pearl
            loop 3 times:
                give player golden apple
            send "&7Du hast das &5LEGENDEN-KIT &7erhalten!"
        if arg 1 is "4":
            clear the inventory of the player
            equip player with chainmail boots of unbreaking 10 with name "&7&lSchuhe &cLUKAS-KIT"
            equip player with chainmail leggings of unbreaking 10 with name "&7&lHose &cLUKAS-KIT"
            equip player with chainmail chestplate of unbreaking 10 with name "&7&lBrustplate &cLUKAS-KIT"
            equip player with chainmail helmet of unbreaking 10 with name "&7&lHelm &cLUKAS-KIT"
            give player diamond sword of sharpness 5 with name "&4Schwert &&cLUKAS-KIT"
            loop 15 times:
                give player steak
            loop 16 times:
                give player ender pearl
            loop 6 times:
                give player golden apple
            send "&7Du hast das &cLUKAS-KIT &7erhalten!"
 
Code:
format gui slot ... of player with ... to run:
    close player's inventory
    (more events)
    (more events)
 
Status
Not open for further replies.