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

How do you check a player's team?

Asked by 9 years ago

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!

1 answer

Log in to vote
1
Answered by
4Bros 550 Moderation Voter
9 years ago

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.

Ad

Answer this question