2

# Will this script work? [Player Points]

Before spending 100rs on a gamepass can someone please tell me if this script works?

local service = game:GetService("PointsService")

service:AwardPoints(GamepassIDHere, service:GetAwardablePoints())
end)



4
BlueTaslem 18044
7 years ago

No. The first parameter to AwardPoints is the userId, not the ID of a gamepass.

service:AwardPoints(player.userId, service:GetAwardablePoints())


This will occur unconditionally though, regardless of the gamepass purchase. You need to check in an if whether or not the player owns the gamepass.

Also note that if a player purchases the game pass, and another player who bought the game pass joins before they do, that player will receive all of the points and the player who joins second will get none.

EDIT: The solution to the last problem I noted is to award the amount for purchasing a gamepass, and store that it has been awarded so that future visits don't attract random bonuses either.

1
Thanks I will make the changes :D, I will vote your answer but I have 0 reputation sorry :( biocommand 30 — 7y
0
@biocommand , You can make his answer as the correct answer, which gives him 1 rep. AmericanStripes 610 — 7y
0
@CreativeEnergy I did biocommand 30 — 7y
0
If it was marked as accepted, there would be a green check mark next to it (Just letting you know -- I don't really care about the points), so if you did, it didn't get saved right. BlueTaslem 18044 — 7y