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

This Player Points Script is not working?

Asked by 10 years ago

Here is the script:

script.Parent.DialogChoiceSelected:connect(function(player, choice)
    if (choice == script.Parent.Choice1) then
            PointsService = game:GetService("PointsService")
game.Players.PlayerAdded:connect(function(p)
while true do 
wait(5) 
game:GetService("PointsService"):AwardPoints(p.userId,1)
print("Point awarded!")
end
end)
    end
    end)

For some reason, when you add points to the server and click the dialog choice 'Choice1', it doesn't give you 1 point. Can somebody help me please? Sorry for unrelated tags.

1 answer

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

Well, for some reason, you added a PlayerAdded event which means the next couple of people would get the point. Not you.

script.Parent.DialogChoiceSelected:connect(function(player, choice)
    if (choice == script.Parent.Choice1) then
        PointsService = game:GetService("PointsService")
        PointsService:AwardPoints(player.userId, 1)
    end
end)
0
Thanks PyccknnXakep 1225 — 10y
0
Thank be by accepting this answer! Shawnyg 4330 — 10y
0
Done PyccknnXakep 1225 — 10y
Ad

Answer this question