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

Points not working?

Asked by
Sxerks3 65
8 years ago

I've been trying to script a points script that will act as an "Elo rating", but nothing's working at the moment.

local points = game:GetService("PointsService")

game.Players.PlayerAdded:connect(function(player)
    local leaderstats = Instance.new("Model")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    local pointers = points:GetGamePointBalance(player.userId)
    if (pointers == 0) then
        pointers = 1500
        points:AwardPoints(player.userId, pointers)

    local pointsystem = Instance.new("IntValue")
    pointsystem.Name = "Rating"
    pointsystem.Value = pointers
    pointsystem.Parent = leaderstats
    end
end)
0
Apparently, the leaderboard works when I remove line 11, but it won't award the starting points. Sxerks3 65 — 8y
0
PointsService:GetUserPointBalanceInUniverse failed because userId <= 0, please supply a positive userId. 07:33:28.234 - Script 'Workspace.Script', Line 8 07:33:28.234 - Stack End Maybe your just working out in Studio? Tried online? buoyantair 123 — 8y
0
Yes, that is sometimes the problem. TheDeadlyPanther 2460 — 8y
0
Thanks, it works live. Sxerks3 65 — 8y

Answer this question