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

Roblox Studio Lag with Loops (while true do or while wait() do) ?

Hello, Im making loops and my studio its lagging, my questions its Should i use:

while true do end

or

while wait(0) do

...Thank you very much

2 answers

No

This will crash your studio

while true do

end

This is just a very fast loop

while wait() do

end
while wait() do is the same as, if not faster than, while wait(0) do

Loops can lag your game. Just a few loop wont unless you're doing something stressful in the loop

Good Luck!

If "while true do" loops don't work, you can always revert back to the good ol' "if then else" loop. Hope this helps!

1 comment

1

What? If then else are parts of a conditional statement, not a loop.

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