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

How do i delete or reset a data store ?

Before i made a script that hold a datastore called "UserData" and i deleted it (i don't remember why)

and now i remade the script but i can't change the value and when i quit and i join it's always the same value so i tried something like this :

local DS = game:GetService("DataStoreService")
local Data = DS:GetDataStore("UserData")
Data:Destroy()

1 answer

✓ Accepted answer

You cannot delete all keys from a GlobalDataStore.

You can however delete one specific key using RemoveAsync()

local DS = game:GetService("DataStoreService")
local Data = DS:GetDataStore("UserData")
Data:RemoveAsync("key")

Or if you want to start your datastore fresh, you can simply change the GlobalDataStore key from UserData to something else, like UserData_2

2 comments

0

Thanks !

0

I always set a variable with the version of the datastore, I simply change that value to make a new datastore, is great for testing

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