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

Is This Player Point Script Correct?

Asked by 10 years ago

It Wouldn't Work During Game So I'm Guessing There Is Something Wrong With It

PointsService = game:GetService "PointsService"
game.Players.PlayerAdded:connect(function(p)    
while true do
wait(60)
game:GetService("PointsService"):AwardPoints(p.userId,1)
print("1 Player Point Awarded")
end
end)

2 answers

Log in to vote
1
Answered by 10 years ago

Remove the first line, it's pointless (pun unintended) and also add an 'if' statement like this:

game.Players.PlayerAdded:connect(function(plr)
while true do
wait(60)
local serv=game:GetService("PointsService")
if serv:GetAwardablePoints()>0 then
serv:AwardPoints(plr.userId,1)
end
end
end)

This answer is brought to you buy Chipio Industries

Ad
Log in to vote
0
Answered by 10 years ago

Kinda wondering why you declared a variable for the points service up top and then didn't use it because you ended up getting the service again anyway but you might be getting an error on that top line because you don't have parenthesis to enclose the argument "PointsService"

Answer this question