How do you make a loop?
✓ ANSWER ACCEPTED
How to loop?
2 answers
✓ Accepted answer
Since I'm not at home, I can't give you a proper link, but go to wiki.roblox.com, and search loops. There's a couple: While, Generic For, Numeric For, repeat, etc.
while wait() do
--insert code here
end
This is pretty much a basic loop but remember there are many other loop forms and not just the while wait() version.
You could also make a loop using .Stepped and .Heartbeat for server scripts or .RenderStepped for local scripts in RunService which both of them are faster than the while wait() form
game:GetService("RunService").RenderStepped(function() --locals only
end)
game:GetService("RunService").Stepped(function() --server sided only
end)
game:GetService("RunService").Heartbeat(function() -- server sided only
end)
or you could just use a for loop
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
This Question has been asked and answered multiple times; Please use the Search-Engine to check for any past or existing Questions of this type. :)