Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a color changing brick?

Asked by 5 years ago
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

Log in to vote
0
Answered by
Rheines 661 Moderation Voter
5 years ago
Edited 5 years ago

To change the color of a BasePart, you need to set its BrickColorusing 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
0
Thanks Xanfar38 -3 — 5y
Ad

Answer this question