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

Surface Gui Random Color?

Asked by 9 years ago

while true do

script.Parent.BackgroundColor3 = BackgroundColor3.Random()

wait(0.5)

end

I know very little about scripting, but I figured with the knowledge I have I could make this simple script. But, I guess not. Any help please?

2 answers

Log in to vote
1
Answered by
pauljkl 10
9 years ago

BrickColor.random().Color

Ad
Log in to vote
0
Answered by 9 years ago

Close!

Color

BackgroundColor3 only works as a property, but not as a Color3 constructor. Additionally, there is no 'Random' color constructor, so you're going to have to use Random Values or the random BrickColor.

while true do
local ran1 = math.random(0,255)
local ran2 = math.random(0,255)
local ran3 = math.random(0,255)
script.Parent.BackgroundColor3 = Color3.new(ran1,ran2,ran3)
end

Or:

while true do
script.Parent.BackgroundColor3 = BrickColor.Random().Color
end

Answer this question