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
while true do
wait(1)
script.Parent.SelectionBox.Adornee = script.Parent
SelectionBox.Color3 = BrickColor.new(math.random(1,255))
end

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
script.Parent.SelectionBox.Adornee = script.Parent 

while true do 
wait(1)
local randomColor = BrickColor.Random().Color
script.Parent.SelectionBox.Color3 = randomColor 
end 

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.

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


Final Product

script.Parent.SelectionBox.Adornee = script.Parent

while wait(1) do
    SelectionBox.SurfaceColor3 = Color3.new(math.random(1,255)/255,math.random(1,255)/255,math.random(1,255)/255)
end



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

script.Parent.SelectionBox.Adornee = script.Parent

while wait(1) do
    SelectionBox.SurfaceColor3 = BrickColor.Random().Color
end
0
No work :( BringMeTacos 20 — 9y

Answer this question