script.Parent.MouseButton1Click:connect(function() if script.Parent.Parent.Parent.Parent.Armrest.GUI.Crew.BackgroundColor3 == Color3.new(0, 255, 0) then do script.Parent.Parent.Parent.Parent.Armrest.GUI.Crew.BackgroundColor3 = Color3.new (255, 0, 0) script.Parent.TextColor3 = Color3.new (255, 0, 0) end elseif script.Parent.Parent.Parent.Parent.Armrest.GUI.Crew.BackgroundColor3 == Color3.new(255, 0, 0) then do script.Parent.Parent.Parent.Parent.Armrest.GUI.Crew.BackgroundColor3 = Color3.new (0, 255, 0) script.Parent.TextColor3 = Color3.new (255, 170, 0) end end end)
I can tell you for a fact that the ".Parent."s here are fine. It's an issue with the color.
I want to check to see if BackgroundColor3 is red or green and then change it to the opposite.
script.Parent.MouseButton1Click:connect(function() if script.Parent.Parent.Parent.Parent.Armrest.GUI.Crew.BackgroundColor3 == Color3.new(0, 255/255, 0) then do script.Parent.Parent.Parent.Parent.Armrest.GUI.Crew.BackgroundColor3 = Color3.new (255/255, 0, 0) script.Parent.TextColor3 = Color3.new (255/255, 0, 0) end elseif script.Parent.Parent.Parent.Parent.Armrest.GUI.Crew.BackgroundColor3 == Color3.new(255/255, 0, 0) then do script.Parent.Parent.Parent.Parent.Armrest.GUI.Crew.BackgroundColor3 = Color3.new (0, 255/255, 0) script.Parent.TextColor3 = Color3.new (255/255, 170/255, 0) end end end)
You need to divide all the color stuff by 255