while true do script.Parent.BrickColor = BrickColor.new(math.random("Really red", "Bright blue")) end
Why isnt it working ?
How do u do it correctly
BrickColor3 is not a thing on Roblox Studio. You would most of the time use Color3.new()
with Guis. However, there are about 2 ways that I am aware you can do a random BrickColor
for a Part
. Also, your script also won't work 'cause you forgot to put a wait() inside of the infinite loop.
There are about 2 ways that I am aware of in which you can give a Part
a random BrickColor
.
while wait() do script.Parent.BrickColor = BrickColor.new(math.random(1, 100)) -- While BrickColor3.new() is not a thing on Roblox. BrickColor.new() is a thing on Roblox. However, when using the math.random() method make sure you put numbers inside of the parenthesis. Those are the range of numbers in which it selects a random number in. If you leave it blank it will give you a decimal, not a whole number. end
The above script is one way to choose a BrickColor
however, one of the most used ways and easiest ways to choose a random BrickColor
would have to be the BrickColor:random()
method specially made in Roblox, for the specific use of choosing a random BrickColor
from the different BrickColor
s in the palette.
while wait() do script.Parent.BrickColor = BrickColor:random() -- You can even do the prefix "." instead of ":" end
~~ KingLoneCat