I'm not trying to make it award points inside the game, just on the leader board outside the game.
COMMUNITY QUESTION
How do i make it award 1 point on the game leader board every time someone visits my game?
1 answer
This code is untested but try this out. Let me know if you get any errors!
-- declare service
local PointsService = Game:GetService("PointsService")
-- Bind function to player added event
game.Players.PlayerAdded:connect(function(player)
-- Get total number of points this game has already awarded to the player
local universeBalance = PointsService:GetGamePointBalance(player.userId)
-- Check if the player hasn't gotten any points yet. If true, award the points.
if ( universeBalance == 0) then
PointsService:AwardPoints(player.userId, 1)
end
end)
-- Bind function to when points are successfully awarded
PointsService.PointsAwarded:connect(function(userId, userBalanceinUni, userBalance)
-- Show message indicating that a player has gotten points
local message = Instance.new('Message')
message.Text = "Point awarded to " .. userId .. ". This player now has " .. userBalance .. " points total!"
message.Parent = workspace
wait(5)
message:Destroy()
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I just want it to award points every time someone visits my game secretly so i can see how many times they've visited, Also i'm getting an error on line 10.
It's not posting to the leader board but it is rewarding me 1 point.