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

How do i award a Team Leaderboard Points?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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)
Ad

Answer this question