I'll always see things like use while true do or use while wait() do. I'm really confused on which I should be using. What is the real difference?
COMMUNITY QUESTION
What's the real difference between while true do and while wait() do?
1 answer
while true do will keep looping while a value you set is true.
For example:
local CatsAreCute = true
while CatsAreCute do
print("Cats are cute.")
end
But if you change the value to false, it won't work because it is not true anymore. You can also do a while false do.
But in a while wait() do it will keep looping endlessly while waiting literally no seconds, it will keep on instantaniously, but with some small intervals to avoid crashing and loss of data.
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
while true do is better
read this https://docs.google.com/document/d/1ieZ8OzXPiXe3R7rs_xWmYZOnhQevlagN0ZWwoj_zKP4/edit
that will explain everything
(Sorry for my bad en.)When you use "while true do" the script repeating, when the script inside of it ends. So if you use "while wait() do", when script inside of it ends, next repeat starting after any seconds(while wait(3) do - repeating after 3 secs)
while wait() do should not be used.
ever.
Yeah really read the article Phlegethon5778 posted. You also shouldn't use wait() as your condition because it's a hack. It abuses the fact that wait returns a number corresponding to the time that the thread was yielded for.