Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a script repeat itself over and over again?

4 answers

Hello!

Use a while loop.

while true do
	print("I'm cool")
	wait()
end

Make sure to add a wait() in there or studio will crash!

2 comments

0

It doesn't crash, it hangs.

0

Well with my literal bucket of garbage computer it does.

while true do is the easiest loop you can have,

while true do
	elite hacker code here
end

This depends if you want it too go on forever or a set amount of time.

If you would like it to repeat a certain amount of times do this.

for i = 0,100 do
--Code here
end

Change '100' too whatever number you want.

If you would like it to repeat forever do this

while true do
wait()--make sure you have this. Without it. It will crash the Server/Client.
end

If this helps. Make sure to accept my Answer.

This discussion is preserved as it was. New answers, comments, and votes are closed.