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

How would I loop Loop/Repeat?

Redlight.Enabled = true
wait(3)
Redlight.Enabled = false
wait(3)

I want it to repeat it self, so it always blinks the redlight. What is the loop code?

4 answers

while wait(3)do
	Redlight.Enabled=not Redlight.Enabled
end

Switches Redlight.Enabled every 3 seconds

while true do
Redlight.Enabled = true
wait(3)
Redlight.Enabled = false
wait(3) -- I added this because you don't want it to loop instantly back to on. Needs some smoothness, y'know?
end

1 Redlight.Enabled = true 2 wait(3) 3 Redlight.Enabled = true 4 wait(3)

It will repeat that way.

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