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

When would I use while true do and Stepped?

Asked by
trecept 367 Moderation Voter
6 years ago

So until recently I've always used while true do to repeat something super quickly, and ever since I've discovered Stepped I've been replacing all my scripts with while true into using stepped, which seems to be so much less laggy and more efficient. Is there any reason I would not want to use RunService stepped over while true do?

0
You should avoid using infinite loops and the run service where possible. User#5423 17 — 6y
0
If you describe your situation we could probably give you a solution that's better than both RunService and infinite loops. For example, if you want to translate something smoothly from one position to another, you could look into using TweenService. mattscy 3725 — 6y

Answer this question