b=script.Parent
while true do
wait(1)
num=math.random(1, 3)
if num == 1 then
b.BackgroundColor3 = Color3(255,0,0)
if num == 2 then
b.BackgroundColor3 = Color3(255,125,0)
if num == 2 then
b.BackgroundColor3 = Color3(255,255,0)
if num == 3 then
b.BackgroundColor3 = Color3(0,255,0)
end
end
end
end
end
This is my code. I do not know why it is not working. I am a beginner coder and I would like a work around this so I can improve. :)
It is supposed to change a button GUI's background color to different colors in the rainbow, however, the colors do not change. The script analysis says there are no errors.
Thanks!
