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.

3 comments
This still would not work
@hex yes it would. do-end is a valid form of scripting. k
@wazap Not exactly necessary but definitely would work