I have been working on the same script now to no avail. It hurts my head so much and makes me want to quit. All I want to do is basically do this:
- if a player is on "team 1" and they kill a player from "team 2", their team gets +1 added to the score they have ( ex. If score is 1 , another kill would make it = 2 and etc..) Im trying to do the above and also add if "team 2" kills a player from "team 1", they also get +1 points.
This is the script. It has no error in output but one thing i noticed was that is said unknown global player.... How would I fix that?
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Char)
Char:WaitForChild("Humanoid").Died:connect(function()
if player.TeamColor == BrickColor.new("Camo") then --You could change this color to your own.
game.Teams.Sentinel.Score = game.Teams.Sentinel.Score + 1
script.Parent.Text = game.Teams.Sentinel.Score.Value
--Assuming "Score" is a IntValue, then add `.Value` to it. This would give an error without it.
elseif player.TeamColor == BrickColor.new("Bright red") then --You could change this color to your own.
--What i've done is, what if the other team kills the other person? This would give them a score as well.
game.Teams.Atlas.Score = game.Teams.Atlas.Score + 1
script.Parent.Parent.Atlas.Text = game.Teams.Atlas.Score
--Change TEAM2 to your other team, besides "Sentinel".
end
end)
end)
end)

1 comment
Thanks A lot!!