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

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

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:

1game.Players.PlayerAdded:connect(function(plr)
2while true do
3wait(60)
4local serv=game:GetService("PointsService")
5if serv:GetAwardablePoints()>0 then
6serv:AwardPoints(plr.userId,1)
7end
8end
9end)

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