I want to make it when a Player is alive for 100 Seconds, they get 1 Point, but this doesn't work. Can anyone help me? It's in ServerScriptStorage.
players = game.Players:GetPlayers()
currency = "Seconds Alive"
for i=1,#players do
if players[i].leaderstats[currency].Value == 100 then
local PointsService = Game:GetService("PointsService")
local pointsToAward = PointsService:GetAwardablePoints()
local universeBalance = PointsService:GetGamePointBalance(player.userId)
if ( pointsToAward > 0 and universeBalance == 0) then
PointsService:AwardPoints(player.userId, 1)
end
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)
