Hello, I wanted to make buttons like the ones in flood escape 2, but I couldn't figure out how to make an if statement if a part is a certain color. Here is the code I have:
if game.Workspace.Interactives._Button2.Light.BrickColor == ("Bright green") then
game.Workspace.Interactives._Button1.Hitbox.Touched:Connect(function()
game.Workspace.Interactives._Button1.Light.BrickColor = BrickColor.new("Bright red")
game.Workspace.Interactives._Button1.Hitbox:Destroy()
game.Workspace.Interactives._Button2.Light.BrickColor = BrickColor.new("Bright green")
print("Button 2 pressed!")
end)
end
So basically if you press button 1 it destroys the hitbox and then button 2 turns green, but its only supposed to work when button 2 is green to activate it, but button 2 doesn't activate at all. Please help?

1 comment
It should be == BrickColor.new("Bright green")