Want to stay connected to the Scripting Helpers community and get real-time help? Join the Scripting Helpers Discord Server!
Ad
Log in to vote
0

Datastore error handling testing?

Asked by
trecept 129
8 days ago
FindData = function(plr,level, gold)
    local success, msg = pcall(function()
        GetData = PlayerData:GetAsync(plr.UserId)
    end)
    if success then
        if GetData then
            level.Value = GetData[1]
            gold.Value = GetData[2]
        else
            level.Value = 1
            gold.Value = 0
        end
    else
        print("Data could not be saved.")
    end
end

I'm trying to create error handling for my datastore so that I don't encounter any bad errors that could remove purchases (with ingame gold or even robux)

I have this function to get player data and I'm not sure how to test if it'd work or not if there was an error? I'm nervous someone will spend robux to get some perks and then loose their purchase e.g buying gold and loosing their data?

0
If you make a developer product and buy it in-game you won't lose robux since it'll be a "Test Purchase". Consider doing that. :) basicecstasy 109 — 8d
0
as basicecstasy said use dveloper product :) Is_Hunter 23 — 8d

Answer this question