I have tried to do: while true do game.workspace.part.Color = game.workspace.part.Color.Random() wait(100) end
But it never changes color, can someone tell me why? I have only been coding in Lua for a couple months on the dev wiki.
Okay, so first of all "color" is not what you want. You want BrickColor. Color has 3 numbers so if you wanted you could do
function random() num1 = math.Random(1,255) num2 = math.Random(1,255) num3 = math.Random(1,255) end while true do random() -- this calls the function game.Workspace.Part.Color = Color3.new(num1, num2, num3) wait(100) end
Of course the way simpler way to do it with less colors is
while true do game.Workspace.Part.BrickColor = BrickColor.Random() wait(100) end
Hope this helps!!
You need to change it to brickcolor, you can't just say color. Also it's going to change every 100 seconds, since you said wait(100)
Here what I came up with.
while true do
game.workspace.part.BrickColor = BrickColor.Random() wait(1)
end
Change the wait to whatever you prefer.