How do you increase a leaderstat of all players on a specific team? In my game all members of the "Bright red" team is supposed to recieve 150 XP when they win the game, but it is not working.
for i,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == BrickColor.new("Bright red") then
v.leaderstats.XP.Value = v.leaderstats.XP.Value + 150

3 comments
have you put some prints in between to make sure the code actually runs?
Yes
BrickColor.new gave me trouble in the past. Try replacing line 2 with: if v.TeamColor == Color3.fromRGB(196, 40, 28) then