Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

This Player Points Script is not working?

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

✓ Accepted answer

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)

3 comments

0

Thanks

0

Thank be by accepting this answer!

0

Done

This discussion is preserved as it was. New answers, comments, and votes are closed.