This has been asked before but gained no traction so I’ll request again.
Please extend the player points API to allow to reset all player points to zero.
We are reworking what player points represent in our game. We want to use them as a global leader board going forward, but this requires all players to have their points reset since points awarded in the past are highly dissimilar to points that will be awarded going forward.
local player = <player here>;
local pointsService = game:GetService("PointsService");
pointsService:AwardPoints(player.UserId, -pointsService:GetGamePointBalance(player.UserId));
Would require u to have some list of all who ever played ur game or force them to rejoin the game for it to take effect.
Even if u had a list, doing that would take tremendous amount of time.
Sure, but if you hook Vorlias’ code up to a PlayerAdded function and knock out their player points whenever they join next, all you have to do then is use DataStore to make sure you don’t rewipe it. It basically accomplishes the same thing.
This really looks to me like a case of lack of information from APIs. We can’t get every player who have accumulated Player Points in our games, nor can we get all keys of a Data Store without properly setting it up to be able to do that beforehand.
My suggestion for a solution is to do a webscraping of the leaderboard on the website. Then you can figure out who have player points in your game, and can manually clear player points then. It’s just sad that it needs to come to that kind of workaround.
Yes, so why not track it with datastores and display it though playerpoints. I use playerpoints to show XP but I save it with datastores. It prevents problems like these. Either way, OP is going to have to work with datastores if roblox doesnt push out an update to let him clear all playerpoints.
No it doesn’t. Let’s say OP had been doing what you do. He saves score to datastores but displays it through playerpoints. Now he wants to do the same thing he’s doing now – he needs to reset all scores. How is he going to loop through all players who’ve played his game to reset their datastore score? He can’t. He has to do it on PlayerAdded, as he’d have to with PlayerPoints. Using DataStores doesn’t change the issue at all.
No it does not. The leaderboard on the site is tied to playerpoints, regardless of how you save points yourself. When OP makes a change like this to his game, unless he resets all users’ playerpoints, the “All Time” leaderboard sort will not be accurate. Example:
2 players have played OP’s game. Enemy kills award 100 points, and each player has killed 10 enemies, so they have 1000 player points each.
OP changes points so that you only get one for each enemy killed. Right now, the leaderboard is showing 2 players who got 1000 kills instead of 10.
OP decides to clear the player’s data when they join. Player1 joins and has his data wiped. 10 days later, Player2 has not joined and has not had his data wiped. The leaderboards on the site display Player2 as having 1000 kills instead of 10 because he hadn’t joined the game to have them reset.
DataStores do not solve the issue because data still has to be cleared on PlayerAdded. OP needs all players’ scores to be cleared right now, and DataStores do not allow for that.
Even if he used datastores from the start it wouldn’t have helped. Why? You still can only clear data on PlayerAdded, resulting in the same problem as before.
Could use OrderedDataStore to slowly get rid of all the playerpoints if the player points were mirrored in DataStore, but it seems waaaaay too slow and hacky.