Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can someone help me with my Player Points script?

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

✓ Accepted answer

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)

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.

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

This discussion is preserved as it was. New answers, comments, and votes are closed.