"Loop all players" not working...

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

XSKRIPTX

Member
Dec 26, 2017
47
1
8
35
Hey, i have a problem the loop event doesn't work
Code:

code_language.skript:
every 2 seconds:
    if {gen.serv} is true:
        loop all players:
            if 1000 is greater than {gen.money.%loop-players%}:
                add {gen.money.%loop-players%} to {money.%loop-players%}
                add {gen.money.%loop-players%} to {money.%loop-players%}
                add {gen.money.%loop-players%} to {money.%loop-players%}
                stop
            else:
                set {gen.money.%loop-players%} to 1000
                stop
But it doesn't work it will add the money will be only to one player not to all
 
Last edited:
Can you please paste your code into a code box.
It’s really hard to understand and try see errors when it’s inline
[doublepost=1524754397,1524754340][/doublepost]Also in your variable change loop-players to loop-player
 
Can you please paste your code into a code box.
It’s really hard to understand and try see errors when it’s inline
[doublepost=1524754397,1524754340][/doublepost]Also in your variable change loop-players to loop-player
fixed but "loop-player" and "loop-players" it doesn't work
[doublepost=1524769505][/doublepost]
You need to loop players
what do you mean? " add {gen.money.%loop-players%} to {money.%loop-players%} "
 
your last else statement isnt even under an if statement thats why
[doublepost=1524834136,1524834089][/doublepost]Also plz send current code ;-; :emoji_frowning:
 
Hey, i have a problem the loop event doesn't work
Code:

code_language.skript:
every 2 seconds:
    if {gen.serv} is true:
        loop all players:
            if 1000 is greater than {gen.money.%loop-players%}:
                add {gen.money.%loop-players%} to {money.%loop-players%}
                add {gen.money.%loop-players%} to {money.%loop-players%}
                add {gen.money.%loop-players%} to {money.%loop-players%}
                stop
            else:
                set {gen.money.%loop-players%} to 1000
                stop
But it doesn't work it will add the money will be only to one player not to all

I think it's in this part: if 1000 is greater than {gen.money.% Loop-players%}:

If they have 1000 more than {gen.money.% Loop-players%}: it would now work out if all players have less than {gen.money.% Loop-players%} so yes it would not add.
 
Status
Not open for further replies.