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

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

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

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!

Ad
Log in to vote
-1
Answered by 8 years ago

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
What? If then else are parts of a conditional statement, not a loop. User#11440 120 — 8y

Answer this question