This is the code:
game:GetService('Players').PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
print(player.Name,player.Team,player.TeamColor)
if player.Team == "Red" then
_G.claimed = _G.claimed + 1
end
When I reset the game outputs my player name and my team/team brick colour as it's supposed to (Line 4).
The team name it outputs is "Red".
The if statement says if the player is on red add a point. (Of course this only happens when the player dies)
My problem is that it for some reason doesn't add the point. If I remove the if statement it works but it'll give the point even if blue dies (I only want to add the point if red dies).
How can I make this work?

1 comment
You should use an IntValue instead of a global variable. Just my two cents. Makes it easier to read the value.