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

How can I make a color changing brick?

game.Workspace.tile.Color = Color3.fromRGB(255,0,0)

wait(1)

game.Workspace.tile.Color = Color3.fromRGB(0,255,0)

wait(1)

game.Workspace.tile.Color = Color3.fromRGB(0,0,255)

How can I make this a loop?

1 answer

✓ Accepted answer

To change the color of a BasePart, you need to set its BrickColor using the BrickColor.new() constructor or its Color using the Color3.new() constructor.

To make the color loop, all you need to do is to make a while true do loop, which will repeat indefinitely.

You also can put tile into a variable so you don't need to repeat yourself too many times.

local tile = workspace.tile

while true do
	tile.BrickColor = BrickColor.new(255,0,0)
	wait(1)
	tile.BrickColor = BrickColor.new(0,255,0)
	wait(1)
	tile.BrickColor = BrickColor.new(0,0,255)
	wait(1)
end

1 comment

0

Thanks

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