Why do my loops repeat even after I reload the script?

  • 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.
Here:
Code:
on script load:
    while online player count is less than 2:
        broadcast "player count is less than 2  (%online player count%)"
        wait 20 ticks
I'm trying to make the server wait until there is enough players to start a game
[doublepost=1618243073,1618242805][/doublepost]Also, when i try
Code:
exit all loops
it says: "Can't stop any loops as there are no loops present". So I can't really stop the loops unless i restart the server
 
That's because it's an endless loop as long as a second player joins. With every reload you add another of that loop. You can cancel the loop only when you join with a second player or restart the server. In difference to a loop (i.e. loop all players), a while runs constantly in the background for as long as the conditions are met (in your case two players are online) or the server restarts.
 
Status
Not open for further replies.