So I've been trying to make a capture system in which when you click a button, it will start capturing the point. This is the code that I'm having problems with.
script.Parent.ClickDetector.MouseClick:connect(function(player) print("activate") if player.TeamColor == BrickColor.new("Really red") and script.Parent.Parent.Beam.BrickColor ~= BrickColor.new("Really red") then script.Parent.Parent.Beam.BrickColor = BrickColor.new("Really red") end end)
The color of the brick doesn't change, and the output didn't show the text. The game has filteringenabled on by the way. I think the problem is that my if, then statement is too vague, but I don't know how to correctly code it!
If it's inside a serverscript then filtering enabled shouldn't matter, try checking the parents of the script to see if anything is missing. If you get an error from running your code it would be helpful to post it here, other than that everything looks fine in your code.