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

Why isn't this Player script working?

Asked by
TrollD3 105
9 years ago

--It says unexpected symbol near ). It says this in output.



game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Char) Char.Died:connect(function() if player.TeamColor == BrickColor.new("Camo") then --You could change this color to your own. game.Teams.Sentinel.Score.Value = game.Teams.Sentinel.Score.Value + 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.Value = game.Teams.Atlas.Score.Value + 1 script.Parent.Parent.Atlas.Text = game.Teams.Atlas.Score.Value --Change TEAM2 to your other team, besides "Sentinel". end) end) end)

1 answer

Log in to vote
0
Answered by
SurVur 86
9 years ago

First of all, .Died is not an event of the character model, it's an event of the humanoid.

I also think that the "Score" property of a "Team" object is not changed by using Team.Score.Value. I believe it's just Team.Score

If you have an IntValue named "Score", then that's a bad idea considering that there's already a property of "Team" that's "Score".

You also seem to be missing an end.

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)

0
No properties (to my knowledge) have another "spot" inside of it, I mean no property has Value that I know of. There is a property named Value for IntValue,StringValue...etc. This doesn't include things like UDim2,Vector3,etc alphawolvess 1784 — 9y
Ad

Answer this question