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

How do I fix this loop?

Brick = game.Workspace.Part

while true do Brick.BrickColor = BrickColor.Red() wait(5) Brick.BrickColor = BrickColor.Gray() end

What I want it to do is to Make the brick red, then gray, then red, then gray, etc. Im not sure if im using the correct type of loop. Is my first time using a loop and I don't really understand the difference between the 3 types.

1 comment

0

I have answered a Question about 'How to do loops' here: https://scriptinghelpers.org/questions/5892/how-to-do-loops#7836

1 answer

✓ Accepted answer

Must have been syntax errors

local brick = game.Workspace.Part

while true do
	brick.BrickColor = BrickColor.Red();
	wait(5)
	brick.BrickColor = BrickColor.Gray()
	wait(5)
end

http://wiki.roblox.com/index.php?title=Loops

3 comments

0

Woah man you really helping me out

0

One more question, how do I stop a loop? And resume it later if possible

0

A 'break' statement stops a loop

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