Hello. I’ve had my plently share of datastores in my roblox games, and I’ve reached a certain wallblock when trying to delete datastores permanently, by that I mean deleting it entirely, getting rid of all keys and even from it displaying. I’m stuck at the “getting rid of itself” part though.
local dataStore = -- Insert datastore
local allKeyPages = dataStore:ListKeysAsync()
while allKeyPages.IsFinished == false do
local keyPage = allKeyPages:GetCurrentPage()
for key, value in keyPage do
local success, errorMessage = pcall(function()
dataStore:RemoveAsync(key)
end)
if not success then warn("Remove Async Fail!", errorMessage) end
task.wait(0.5) -- Prevent rate limit
end
allKeyPages:AdvanceToNextPageAysnc()
end