So I have a datastore which I want admins to have a reset button for which resets the whole datastore. How would I make it so the data in the datastore is all deleted?
You need to make a new datastore, you can’t clear out any data
Please search for things before making posts, this was already answered here: Is there anyway to clear out all data in a datastore?
I just know that if you change the name of the datastore, you change the entire datastore. For example, if you change
DataStore2 you will have completely different datastores.
If you’re generating the keys based such as
"user_" .. Player.UserId , then resetting all player data is simple as changing
user_ to something else.
This is an unfortunate limitation in how Roblox handles datastores, however there is not a better way to manage this as Roblox only exposes an in-game API and expects persistence for the foreseeable future; They also expect you to use a testing database for testing, or to not enable Studio API access.
To clear confusion, it was because he was asking if he could delete data already saved inside of a datastore which is impossible.
As to your other question that would be another solution that was also mentioned in the post I linked above.
I don’t think that there is a way to clear data. The only thing you can do is changing the datastore name which will result in a total data reset of all players.
Isn’t remove:Async a way to remove data?