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

Why my datastore dont saving bool value?

Asked by 2 years ago

I took that script from my leaderstats datastore script & changed value to save. Also this is server script. Please Help, i need that for my christmas update, one last thing to do! Script:

local ds = game:GetService("DataStoreService"):GetDataStore("QuestData")
    game.Players.PlayerAdded:Connect(function(plr)
            wait(1)
        local plrkey = "id_"..plr.UserId
            local save1 = plr.PlayerGui.QuestGui.CompletedData

            local GetSaved = ds:GetAsync(plrkey)
            if GetSaved then
                    save1.Value = GetSaved[1]
                else
                local NumberForSaving = {save1.Value}
                    ds:GetAsync(plrkey, NumberForSaving)
                end
        end)

    game.Players.PlayerRemoving:Connect(function(plr)
            ds:SetAsync("id_"..plr.UserId, {plr.PlayerGui.QuestGui.CompletedData.Value})
        end)
0
Uhm, did you check if the value of 'CompletedData' is always changed by a server script? It is in the playergui and there is a chance you changed it locally. It can also be because you add a extra 'NumberForSaving' in line 11 AProgrammR 398 — 2y
0
You are right, it was changed by local script... SashaPro336 47 — 2y
0
I didnt knew that SashaPro336 47 — 2y
0
Thanks im gonna try it SashaPro336 47 — 2y
View all comments (3 more)
0
Still dont work SashaPro336 47 — 2y
0
Have you tried testing it outside of studio? NotThatFamouss 605 — 2y
0
Yes, does that matter SashaPro336 47 — 2y

Answer this question