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?
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?
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
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thanks