My friend and I are working on a game together, and he made this script.
yo = script.Parent
while true do yo.BrickColor = BrickColor.Random() wait(0.5) yo.BrickColor = BrickColor.Random() wait(0.5) yo.BrickColor = BrickColor.Random() end
Currently, it switches to every color in the pallet, which is great, except that it turns brown sometimes. I've tried to edit it, but I'm a total noob when it comes to scripting. Can somebody help?
You would make a table that has all the colors that you want to change. Like this:
local colors = {'Bright red', 'Bright green', 'Bright blue'}
Then you would do the math.random. To change the colors randomly
yo.BrickColor = BrickColor.new(colors[math.random(1, #colors)])