1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

"Loop all players" not working...

Discussion in 'Skript' started by XSKRIPTX, Apr 26, 2018.

Thread Status:
Not open for further replies.
  1. X

    XSKRIPTX Active Member

    Joined:
    Dec 26, 2017
    Messages:
    29
    Likes Received:
    1
    Hey, i have a problem the loop event doesn't work
    Code:

    Code (Skript):
    1. every 2 seconds:
    2.     if {gen.serv} is true:
    3.         loop all players:
    4.             if 1000 is greater than {gen.money.%loop-players%}:
    5.                 add {gen.money.%loop-players%} to {money.%loop-players%}
    6.                 add {gen.money.%loop-players%} to {money.%loop-players%}
    7.                 add {gen.money.%loop-players%} to {money.%loop-players%}
    8.                 stop
    9.             else:
    10.                 set {gen.money.%loop-players%} to 1000
    11.                 stop
    But it doesn't work it will add the money will be only to one player not to all
     
    #1 XSKRIPTX, Apr 26, 2018
    Last edited: Apr 26, 2018
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,053
    Likes Received:
    145
    Can you please paste your code into a code box.
    It’s really hard to understand and try see errors when it’s inline
    --- Double Post Merged, Apr 26, 2018, Original Post Date: Apr 26, 2018 ---
    Also in your variable change loop-players to loop-player
     
  3. N

    Normalguy Well-Known Member

    Joined:
    Apr 19, 2018
    Messages:
    98
    Likes Received:
    0
    You need to loop players
     
  4. X

    XSKRIPTX Active Member

    Joined:
    Dec 26, 2017
    Messages:
    29
    Likes Received:
    1
    fixed but "loop-player" and "loop-players" it doesn't work
    --- Double Post Merged, Apr 26, 2018 ---
    what do you mean? " add {gen.money.%loop-players%} to {money.%loop-players%} "
     
  5. N

    Normalguy Well-Known Member

    Joined:
    Apr 19, 2018
    Messages:
    98
    Likes Received:
    0
    What’s the errors?
    Show us the code
     
  6. X

    XSKRIPTX Active Member

    Joined:
    Dec 26, 2017
    Messages:
    29
    Likes Received:
    1
    The ERROR is it add only to 1 player not to all online players
     
  7. JustADev

    JustADev Well-Known Member

    Joined:
    Apr 8, 2017
    Messages:
    380
    Likes Received:
    9
    your last else statement isnt even under an if statement thats why
    --- Double Post Merged, Apr 27, 2018, Original Post Date: Apr 27, 2018 ---
    Also plz send current code ;-; :emoji_frowning:
     
  8. F

    FabricioSouza Well-Known Member

    Joined:
    Mar 15, 2018
    Messages:
    267
    Likes Received:
    3
    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.
     
Thread Status:
Not open for further replies.
Loading...