I know I already asked this but, 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 == BrickColor.new("Bright green") then
game.Workspace.Interactives._Button2.Hitbox.Touched:Connect(function()
	game.Workspace.Interactives._Button2.Hitbox:Destroy()
	game.Workspace.Interactives._Button3.Light.BrickColor = BrickColor.new("Bright green")
	print("Button 2 pressed!")
end)
end

I already tried a similar script and that did not work. This does not work either. Any help?

1 comment

0

Firstly, I highly recommend using variables to stop repeating the "game.Workspace.Interactives...". Secondly, try using print statements to make sure that the BrickColor is correct and if the if statement is true or not.