Color3 uses Color3.new(). Not BrickColor.new().
Color3
Color3 is not actually 1 to 255, it's 0 to 1. So take your number(like 125) and divide it by 255.
1 | Color 3. new( 233 / 255 , 65 / 255 , 87 / 255 ) |
Final Product
1 | script.Parent.SelectionBox.Adornee = script.Parent |
4 | SelectionBox.SurfaceColor 3 = Color 3. new(math.random( 1 , 255 )/ 255 ,math.random( 1 , 255 )/ 255 ,math.random( 1 , 255 )/ 255 ) |
Hope it helps!
Other Stuff
You can get a random color though BrickColor! BrickColor.Random()
and BrickColor.Color
.
BrickColor.Random()
BrickColor.Random() would get a random BrickColor.
BrickColor.Color
Turns the brickcolor into a color3 value
Which would make
1 | script.Parent.SelectionBox.Adornee = script.Parent |
4 | SelectionBox.SurfaceColor 3 = BrickColor.Random().Color |