increase a variable for all players

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

Toadyboii

Member
Jan 31, 2024
26
0
1
16
<
every 1 second:
if {TokenCounter} is true:
loop all players in world "arena":
if {ArenaGo} is true:
set {TokenCounter} to false
set {Tokens.%player's uuid%} to 25
send "§a+25 Tokens" to loop-players
send "§c§LNEXT WAVE ARRIVING IN 20 SECONDS" to loop-players
wait 20 seconds
>
this code doesnt work.It only send the messages and increases the tokens uuid for 1 player.Ive tried players in the world "arena"(name of the world this happens in) but it doesnt work for uuids and gets an error.How to fix/write this differently to work?
 
It should be {Tokens::%uuid of loop-player%}
the colons work but I've encountered a lot of problems with using the periods instead of colons.
 
Try: {Tokens::%loop-player's uuid%}. You will need to use loop-player regardless for it to potentially work because otherwise it doesn't register that it's for all looped players. Also, just FYI but you'll want to avoid looping/doing things every second via Skript as that can bring down performance. If you're able to find a way around it, it'll cause your server to have way better performance (This is also why if you've seen code for sidebars/titles, they're never looped every second but instead updated via a function when the value changes).