Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

DataStore Error - 104: Cannot store Dictionary in DataStore?

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

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

1 comment

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.