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: