Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to reset/delete DataStores?

Asked by
8jxms 9
4 years ago

As I'm not very good at making DataStores, I just found a script on Youtube. For some reason it messed up the data it was storing by making all the stats the same value. Now I fixed it, but I wanna reset the DataStores. Here is the (server)script I'm using(part of one big stats script):

    local strengthData, rebirthsData

    local success,errormessage = pcall(function()
        strengthData = DataStore:GetAsync("strength-"..player.UserId)
        rebirthsData = DataStore:GetAsync("rebirths-"..player.UserId)
    end)

    if success then
        if strengthData then
            strength.Value = strengthData
        end
        if rebirthsData then
            rebirths.Value = rebirthsData
        end
    end
end)


game.Players.PlayerRemoving:Connect(function(player)
    local success, errormessage = pcall(function()
        DataStore:SetAsync("strength-"..player.UserId,player.leaderstats.Strength.Value)
        DataStore:SetAsync("rebirths-"..player.UserId,player.leaderstats.Rebirths.Value)
    end)
end)
0
Are you using datastore2? If not i cant help. D: Fl3eandFlo3e 18 — 4y
0
I honestly have no idea. How can you tell? 8jxms 9 — 4y
0
just change the key Fad99 286 — 4y

Answer this question