So an exploiter was in my game and got a lot of stats and my game got global leaderboards. I want to reset his leaderstats before banning him. I’ve tried using the DataStore plug-in but I don’t really understand it. So I want to ask for help.
Use can use RemoveAsync to remove his stats from the leaderboards.
GlobalDataStore:RemoveAsync("Player_Key")
You can type this into the command bar in studio, or you could bind this to a custom admin command, whichever is more convenient for you.
The Player_Key is a unique identifier for the datastore to be able to find the players data. If you look in the datastore script or where ever it saves the data you should be able to see a line of code saying something like this
GlobalDataStore:SetAsync("Player_Key", data)
the player key is normally the players user id Player.UserId
but it can be different. If it says Player.UserId
then you will have to get his UserId and replace it with the “Player_Key”. And you will most likely have to remove him from the global leaderboards separately. Most games have seperate datastores for global leaderboards and leaderstats
Use the command bar to overwrite his Datastore with using his userid.
You can use these 2 commands to delete the players data from the datastore. You can use this one to remove the players data
game:GetService("DataStoreService"):GetDataStore('Data0'):RemoveAsync("user_1934708292")
and you can use this one to remove the player from the leaderboard
game:GetService("DataStoreService"):GetOrderedDataStore("PrestigeStats"):RemoveAsync(1934708292)