Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Repeat Until... Or... Loop Isn't Working?

Asked by
Wyqkrn 9
4 years ago
function WaveWait()
SkipWave.Value = 1
CheckForEnemies()
    repeat
        print(Enemies)
        wait(0.5)
        CheckForEnemies()
    until PlayerSkippedWave.Value == 1 or Enemies == 0
SkipWave.Value = 0
PlayerSkippedWave.Value = 0
end

So, I have this loop inside this function. However, when PlayerSkippedWave.Value = 1 the loop does not end for some reason. PlayerSkippedWave is a NumberValue. Anyone have an idea of why it's broken?

0
From where are you changing the value of "PlayerSkippedWave" , Server or Client ? And is that function server-sided or client-sided ? iDarkGames 483 — 4y
0
Yeah ^^^ if you're changing the value of an intValue (which is on the server) from a local script, you won't make any changes to the value itself. You need a remote event for that. royaltoe 5144 — 4y
0
repeat <what you're doing> until <end condition> EmbeddedHorror 299 — 4y

Answer this question