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

How would you pause a script?

Asked by 9 years ago

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

0
while not var do wait(.2) end GoldenPhysics 474 — 9y

1 answer

Log in to vote
3
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

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
0
Thanks!!! colinthewierd 10 — 9y
Ad

Answer this question