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

Status
Not open for further replies.

xflyer_23

Member
May 12, 2020
14
0
0
34
im having trouble with loop all players, it doesnt work

Code:
command /toggleitems:
    trigger:
        if {gen.%player%} is true:
            set {gen.%player%} to false
            send "&dYou are no longer recieving items every 15 seconds" to player
        else:
            set {gen.%player%} to true
            send "&dYou are now recieving items every 15 seconds" to player

loop all players:
    if {gen.%player%} is true:
        add 1 of (random item out of all items) to inventory of {gen.%player%}
 
im having trouble with loop all players, it doesnt work

Code:
command /toggleitems:
    trigger:
        if {gen.%player%} is true:
            set {gen.%player%} to false
            send "&dYou are no longer recieving items every 15 seconds" to player
        else:
            set {gen.%player%} to true
            send "&dYou are now recieving items every 15 seconds" to player

loop all players:
    if {gen.%player%} is true:
        add 1 of (random item out of all items) to inventory of {gen.%player%}
You need to use something like %loop-player% not %player%
 
Status
Not open for further replies.