Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would you pause a script?

I wanna know how to keep the script from continuing until a certain variable is true, how would I do this?

1 comment

0

while not var do wait(.2) end

1 answer

✓ Accepted answer

Simply repeatedly wait() until the value is true.

I love repeat loops, they translate to English so well. What we're basically doing is telling the computer to repeat the wait() function until the condition is met.

local value = true

--Will wait until value equals true
repeat wait() until value

--Will wait until value equals false
repeat wait() until not value

1 comment

0

Thanks!!!

This discussion is preserved as it was. New answers, comments, and votes are closed.