As I understand it, doing
while true do --code wait() end
is considered better than doing
while wait() do --code end
Why is this?
It isn't bad, people just say it's bad practice. wait()
is a ROBLOX Lua function, the reason it works is because wait()
returns values making it true
. It's bad practice because if you were to move on from ROBLOX's engine, your loops wouldn't work because wait()
wouldn't return anything.
I got this information from this video by ScriptGuider:
Marked as Duplicate by User#24403
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?