Help with GUI on loop

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

Matthew_Cash

Member
Jun 20, 2017
17
1
0
20
I am trying to build a skript that will bring up a GUI will all of the players on the server, and when you click a player head, it will run command /duel </waitmenu <clicked player> I am running the format command on a loop-player, and the click action cannot remember what player is should run /waitmenu with. Can someone please help. Right now, the command will always do /waitmenu with the last player in the GUI.

code_language.skript:
command /duelmenu:
    trigger:
            open chest with 3 rows named "          &b&lDuel a Player" to player
            wait 3 ticks     
            set {duel.playercount} to 0
            clear {_players::*}
            loop all players:
                if loop-player is not player:
                    add loop-player to {_players::*}
                    set {_slot} to {duel.playercount} + 9
                    format slot {_slot} of player with loop-player's skull named "&a&l%loop-player%" with lore "&cClick to duel me!||||&eOr use:||&b/duel %loop-player%" to run [make player execute command "/waitmenu %{_players::%{duel.playercount}%}%"]
                    add 1 to {duel.playercount}
 
Last edited:
Status
Not open for further replies.