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

Can someone help me with my Player Points script?

Asked by 10 years ago

It won't find the AwardablePoints for some reason... Help?

local PointsService = Game:GetService("PointsService")

game.Players.PlayerAdded:connect(function(player)

    local pointToAward = PointsService:GetAwardablePoints()
    local universeBalance = PointsService:GetGamePointBalance(player.userId)

    if ( pointsToAward > 999999 and universeBalance == 9999999999) then
        PointsService:AwardPoints(player.userId, 1)
    end
end)

PointsService.PointsAwarded:connect(function(userId, userBalanceinUni, userBalance)
    local message = Instance.new('Message', game.Workspace)
    message.Text = "Point awarded to " .. userId .. ". This player now has " .. userBalance .. " points total!"
    wait(5)
    message:Destroy()
end)

3 answers

Log in to vote
0
Answered by
c0des 207 Moderation Voter
10 years ago

You had "local pointToAward" but later on said "pointsToAward", so I think you missed an S in the local variable.

local PointsService = Game:GetService("PointsService")

game.Players.PlayerAdded:connect(function(player)

    local pointsToAward = PointsService:GetAwardablePoints()
    local universeBalance = PointsService:GetGamePointBalance(player.userId)

    if ( pointsToAward > 999999 and universeBalance == 9999999999) then
        PointsService:AwardPoints(player.userId, 1)
    end
end)

PointsService.PointsAwarded:connect(function(userId, userBalanceinUni, userBalance)
    local message = Instance.new('Message', game.Workspace)
    message.Text = "Point awarded to " .. userId .. ". This player now has " .. userBalance .. " points total!"
    wait(5)
    message:Destroy()
end)

Ad
Log in to vote
-2
Answered by 10 years ago

This script doesn't work, as you have set it to say "If the amount of award-able points is 999999 and the amount of points that the character has earned before in the game universe is 9999999999, then give them one point". It is very unlikely that a player will fit those specified conditions, but if they do, this script will give them a point.

Log in to vote
-3
Answered by 10 years ago

Isn't that cheating (Just by looking at it) it gives you an incredible amount of points?

Answer this question