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

Player Points not reflecting current amount on the leaderboard?

Asked by 8 years ago

I'm trying to make the player's current amount of Points show on the leaderboard. I've tried using GetGamePointBalance with the player's userId, but it wouldn't work.

game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Model")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player
local points = Instance.new("IntValue")
    points.Name = "Points"
    points.Parent = leaderstats
    points.Value = game.Players:GetGamePointBalance(player.userId)
end)

1 answer

Log in to vote
0
Answered by
xAtom_ik 574 Moderation Voter
8 years ago

I think you just threw the function in the wrong place.

game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Model")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player
local points = Instance.new("IntValue")
    points.Name = "Points"
    points.Parent = leaderstats
    points.Value = game:GetService("PointsService"):GetGamePointBalance(player.userId)
end)
Ad

Answer this question