Remove the while true, and make a table/array of the colors you want. Then use this code:
colors = {"Really red", "Really blue", "Really black"}
random = math.random(1, #colors)
script.Parent.BrickColor = BrickColor.new(colors[random])
What it does is it creates a table/array of color names, and after that picks a random number between 1, and the number of values in that array. Then, if you use that random number as the array index for the colors table:
script.Parent.BrickColor = BrickColor.new(colors[random])
colors[random]
then it essentially picks a random color. You might want to use randomseed as well to make sure you have totally random numbers:
math.randomseed(tick())
1 comment
Put this as a serverscript Hope it helps u out