Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

If part is a color then? [closed]

Asked by 6 years ago

This question already has an answer here:

If part is a color then?

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?

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. chomboghai 2044 — 6y

Marked as Duplicate by fredfishy and evaera

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?