I'm trying to make a button that changes the color of surface GUIs, but it doesn't do anything.
local button = script.Parent
color = math.random(1,4)
button.MouseButton1Down:connect(function()
if color == 1 then
script.Parent.BackgroundColor3.new(40,40,40)
script.Parent.Parent.Parent.Taskbar.BackgroundColor3.new(40,40,40)
script.Parent.Parent.Parent.Taskbar2.BackgroundColor3.new(40,40,40)
script.Parent.Parent.Parent.ImageLabel2.BackgroundColor3.new(40,40,40)
script.Parent.Parent.Parent.StartMenu.BackgroundColor3.new(40,40,40)
script.Parent.Parent.Parent.Settings.BackgroundColor3.new(40,40,40)
if color == 2 then
script.Parent.BackgroundColor3.new(255,0,0)
script.Parent.Parent.Parent.Taskbar.BackgroundColor3.new(255,0,0)
script.Parent.Parent.Parent.Taskbar2.BackgroundColor3.new(255,0,0)
script.Parent.Parent.Parent.ImageLabel2.BackgroundColor3.new(255,0,0)
script.Parent.Parent.Parent.StartMenu.BackgroundColor3.new(255,0,0)
script.Parent.Parent.Parent.Settings.BackgroundColor3.new(255,0,0)
if color == 3 then
script.Parent.BackgroundColor3.new(0,255,0)
script.Parent.Parent.Parent.Taskbar.BackgroundColor3.new(0,255,0)
script.Parent.Parent.Parent.Taskbar2.BackgroundColor3.new(0,255,0)
script.Parent.Parent.Parent.ImageLabel2.BackgroundColor3.new(0,255,0)
script.Parent.Parent.Parent.StartMenu.BackgroundColor3.new(0,255,0)
script.Parent.Parent.Parent.Settings.BackgroundColor3.new(0,255,0)
if color == 4 then
script.Parent.BackgroundColor3.new(0,0,255)
script.Parent.Parent.Parent.Taskbar.BackgroundColor3.new(0,0,255)
script.Parent.Parent.Parent.Taskbar2.BackgroundColor3.new(0,0,255)
script.Parent.Parent.Parent.ImageLabel2.BackgroundColor3.new(0,0,255)
script.Parent.Parent.Parent.StartMenu.BackgroundColor3.new(0,0,255)
script.Parent.Parent.Parent.Settings.BackgroundColor3.new(0,0,255)
end
end
Thanks if you can help, I'm also a bit of a noob at scripting.
