How to delete someones leaderstats/data when they're not in the server?

I’m trying to delete a person’s data from my game since he exploited and it isn’t fair for him to be in the top leaderboard. Is there any way to delete his data when he isn’t inside the game.

Note: He no longer joins my game, so I can’t remove his data by console.

1 Like

Well you could have a remote event in your game that you can use. Then check if you were the one who called it before doing anything so that people can’t take advantage of it. Then the following will remove their data. Now you must use the same key that you saved their data with, so if you use their PlayerId then put that in the parenthesis if you do something else then use that. Also change "DataStore’ to the name of your datastore.

Datastore:RemoveAsync(--key here)

I’m not trying to do that, what I’m trying to do is remove one player’s data.

You could get a datastore editor. The method however that was described above works for one person.

2 Likes

Yeah RemoveAsync removes the data for whoever you put as the parameter, so it will remove 1 persons data, now everyone’s.

Can it remove the data even if they aren’t playing the game anymore?

Have you tried datastore editor plugin? It allows you to edit a specific person’s data. You can ban him from your game which you’ll have to figure out and edit his data to 0.

1 Like

Yes it can. If you show me your script I can write it for you, basically it searches through the datastore until it finds the right key and then it erases that data.

This is a paid plugin, however, it is totally worth it. You can edit datastores and do exactly what you want here. DataStore Editor - Roblox