Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Randomly coloring a GUI button?

Edit: Updated the script.

Extra edit: I now know I need to use Color3.new() .. But I don't know how to randomize it.

local button = script.Parent
local gui = script.Parent.Parent

while gui.Visible == true do -- only does it while it's open?? I will figure that out later I guess.
while true do
	button.BackgroundColor3 =Color3.new() -- this is the part i need help with
end
end

Just looking on how to randomly change the colors. I used to remember but after doing a bit of searching on the wiki, i didn't find anything that worked. (I probs set it up wrong)

1 comment

0

Someone either downvoted my question or took off the +1 point on it ):

1 answer

✓ Accepted answer
local button = script.Parent
local gui = script.Parent.Parent

while gui.Visible do 
    wait()
    local r,g,b = math.random(1,255)/255,math.random(1,255)/255,math.random(1,255)/255
    button.BackgroundColor3 =Color3.new(r, g, b)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.