Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

SelectiveBox not changing color randomly.?

Asked by 9 years ago
1while true do
2wait(1)
3script.Parent.SelectionBox.Adornee = script.Parent
4SelectionBox.Color3 = BrickColor.new(math.random(1,255))
5end

It is supposed to randomly change color's. Any help?

0
Replace Color3 With SurfaceColor3, if it works, please accept! EzraNehemiah_TF2 3552 — 9y
0
I edit mine EzraNehemiah_TF2 3552 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago
1script.Parent.SelectionBox.Adornee = script.Parent
2 
3while true do
4wait(1)
5local randomColor = BrickColor.Random().Color
6script.Parent.SelectionBox.Color3 = randomColor
7end

This will work.

Ad
Log in to vote
0
Answered by 9 years ago

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.

1Color3.new(233/255,65/255,87/255)


Final Product

1script.Parent.SelectionBox.Adornee = script.Parent
2 
3while wait(1) do
4    SelectionBox.SurfaceColor3 = Color3.new(math.random(1,255)/255,math.random(1,255)/255,math.random(1,255)/255)
5end



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

1script.Parent.SelectionBox.Adornee = script.Parent
2 
3while wait(1) do
4    SelectionBox.SurfaceColor3 = BrickColor.Random().Color
5end
0
No work :( BringMeTacos 20 — 9y

Answer this question