So the points leaderboard I am awarding points to is called points. I added this but noticed it added points to all players, not just one team. This is how I thought I did it. Please correct me.
plr = game.Players:GetPlayers(); for i = 1, #plr do; plr[i].leaderstats.Points = plr[i].leaderstats.Points + 10; end;
My point is how can I change this so it only awards points to a certain team?
I prefer for i,v in pairs:
for i,v in pairs(game.Players:GetPlayers()) do if v.TeamColor == game.Teams["TEAMNAME"].TeamColor then v.leaderstats.Points.Value = v.leaderstats.Points.Value + 10 --You need to get to THE VALUE not just the object end end
Whenever you use BoolValue, StringValue, IntValue, etc always, ALWAYS have a .Value when you are after what that value is set to.
Example:
StringValue's value is "Hi there!" and I want to change it:
game.Workspace.StringValue.Value = "Changed"