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
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
#Problem:
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.
#Solution:
There are about 2 ways that I am aware of in which you can give a Part a random BrickColor.
###Here is the first one:
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 BrickColors in the palette.
###Anyways here it is:
while wait() do
script.Parent.BrickColor = BrickColor:random() -- You can even do the prefix "." instead of ":"
end
##I hope I helped in one way or another. Please, if you have any other questions don't be afraid to post a comment below asking about them. Thank you for putting your precious time into reading this answer. I will see you another time.
#PEACE!
~~ KingLoneCat
Why while wait() do ?
Ah i get it, but how can i make it change from color fading to other cuz know it just every 1 second goes to random and can be seen
Well, to make it fade from one color to another you'd probably have to plan out the order and use tables of some sort. It would take a while.
Nah, you could do color3 manipulation of some sort I would imagine.
No, I don't think you could. Pretty sure the RGB format is just for Guis. Then again I am not sure ;-;
while true do
wait(1)
script.Parent.BrickColor = BrickColor.random()
end
hopefully this works.
Yeah, i forgot to put a wait().
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Couldn't you do BrickColor.Random()?
No, because the studio crashes