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

pls help me change it?

Asked by 9 years ago

hai guys i just asking if u can fix this so it can give random player points

PointsService = game:GetService("PointsService")
ammount = 1 -- Ammount of player points awarded after the interval.
time = 1 -- Interval between each player point award.

game.Players.PlayerAdded:connect(function(p)
    while true do
        wait(time*60)
        game:GetService("PointsService"):AwardPoints(p.userId,ammount)
    end
end)

1 answer

Log in to vote
-1
Answered by
Discern 1007 Moderation Voter
9 years ago
PointsService = game:GetService("PointsService")
amount = 1 -- Amount of player points awarded after the interval.
timewait = 1 -- Interval between each player point award.

game.Players.PlayerAdded:connect(function(p)
    while true do
    balance = PointsService:GetAwardablePoints()
    if balance >= amount then
        pcall(function()
            PointsService:AwardPoints(p.userId, amount)
        end)
    else pcall(function()
        PointsService:AwardPoints(p.userId, balance)
        end)
    end
    wait(timewait*60)
    end
end)
Ad

Answer this question