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

Why is my data very inconsistent?

Asked by 6 years ago

Hello i am using a regular datastore script and whenever i force shutdown for updates there a few people whoos data is missing. Please help

0
Can you add the script? User#20388 0 — 6y
0
If you cannot, answer these questions, does it autosave every X seconds or does it save with a button/command/ when the player leaves. Or is it a datastore issue that you can fix with pcall? User#20388 0 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

i have it autosave and it comes up with a problem in the autosave here is the code: while true do wait(120) if can_Save.Value == true then local success,message=pcall(function() StrengthData:SetAsync((uniquekey), {strength.Value}) RebirthData:SetAsync((uniquekey), {rebirths.Value}) OtherData:SetAsync((uniquekey), {Egg.Value,FishingDuck.Value,ChillDuck.Value,Swimming.Value,Camo.Value,Wise.Value,Evil.Value,Stone.Value,Bush.Value,Behind.Value,King.Value,Kills.Value,KingC.Value,current_duck.Value})

            end)
            if not success then
                print("not really found dude")

                wait(30)
                local success,message=pcall(function()
                    StrengthData:SetAsync((uniquekey), {strength.Value})
                    RebirthData:SetAsync((uniquekey), {rebirths.Value})
                    OtherData:SetAsync((uniquekey), {Egg.Value,FishingDuck.Value,ChillDuck.Value,Swimming.Value,Camo.Value,Wise.Value,Evil.Value,Stone.Value,Bush.Value,Behind.Value,King.Value,Kills.Value,KingC.Value,current_duck.Value})
                    print("done")
                end)

            end



        end
    end
0
while true do wait(120) if can_Save.Value == true then local success,message=pcall(function() StrengthData:SetAsync((uniquekey), {strength.Value}) RebirthData:SetAsync((uniquekey), {rebirths.Value}) OtherData:SetAsync((uniquekey), {Egg.Value,FishingDuck.Value,ChillDuck.Value,Swimming.Value,Camo.Value,Wise.Value,Evil.Value,Stone.Value,Bush.Value,Behind.Value,King.Value,Kill billyandme 0 — 6y
Ad

Answer this question