function GetSave(Key)
    local GetSave = Datastore:GetAsync(Key)
    if GetSave then
        dict = GetSave[1]
    else
        local Data = dict
        Datastore:SetAsync(Key, Data)
    end    
end

I have a thing that loads a dictionary datastore and when i go to save it, it doesnt work. But if i take this script out, it does work. So i am loading in the dictionary wrong. how do i do it right lol

2 comments

0

dude use JSon

0

You can't save dictionaries inside datastores. As greatneil80 suggested, you should use JSON. When you save data JSON encode the dictionary, that should convert the dictionary in a JSON list, a string. So the data will be able to get saved. Then when you get the data saved, get the string and JSON decode it. That should convert it in a Lua table.