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

DataStore Error - 104: Cannot store Dictionary in DataStore?

Asked by 3 years ago
local function playerRemoving(player)
    if player == tycoonOwner.Value then
        tycoonClone.Parent = game.Workspace.Tycoons

        for i, v in pairs(PurchasedItem:GetChildren()) do
            local itemClone = v:Clone()
            InfoToSave[itemClone.Name] = itemClone
        end
        print(InfoToSave)
        tycoon:Destroy()
    end
    playerData:SetAsync(player.UserId, InfoToSave)
end

hello, im trying to make an autosave progress for my tycoon. But the problem is, it wont let me save the items in the datastore. What does the error means?

1 answer

Log in to vote
0
Answered by 3 years ago
local function playerRemoving(player)
    if player == tycoonOwner.Value then
        tycoonClone.Parent = game.Workspace.Tycoons
        local InfoToSave = create_table(player)
        local success, err = pcall(function()
            local playerUserID = 'Player_'..player.UserId
            playerData:SetAsync(player.UserId, InfoToSave)
        end)

        if not success then
            warn("Could not save data")
        end
        print(InfoToSave)
    end
    tycoon:Destroy()
    end

I managed to fix it by doing this, but idk what's the problem before

0
Because you can't save instances inside of data store, only store properties of the instance that you need or it's name, that;s up to you. imKirda 4491 — 3y
Ad

Answer this question