Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i award a Team Leaderboard Points?

Im making a cool Game and each round Whoever wins I Want it to award them Leaderboard Points. Please Help I Dont know how to that.

1 answer

You have to loop through each player and check their TeamColor.

local blueTeam = "Bright blue"
local redTeam = "Right red"

function awardPoints(team, amount)
	for i, v in pairs(game.Players:GetPlayers()) do
		if v.TeamColor == BrickColor.new(team) then
			pcall(function()
				v.leaderstats.Points.Value = v.leaderstats.Points.Value + amount
			end)
		end
	end
end

--to award the points, you have to call the function
awardPoints(blueTeam, 5)

This discussion is preserved as it was. New answers, comments, and votes are closed.