Why am I getting this error "103: Dictionary is not allowed in data stores."

I’m getting the error “103: Dictionary is not allowed in data stores.”

How could I modify my code so that what I’m saving isn’t a dictionary? I also don’t understand how it is a dictionary, help would be appreciated on that too.

-- all of the things in the player do exist
	local data = {}
	data.Coins = player.Coins.Value
	data.Equipped1 = player.Equipped1.Value
	data.Equipped2 = player.Equipped2.Value
	data.Items = {}
	data.Items2 = {}
	
	for i,v in pairs(player.Inventory1:GetChildren()) do
		table.insert(data.Items, v.Name)
	end
	
	for i,v in pairs(player.Inventory2:GetChildren()) do
		table.insert(data.Items2, v.Name)
	end
	
	local success, erromessage = pcall(function()
		DataStore:SetAsync(player.UserId, data)
	end)

Thanks!

It seems like you’re using a ordered datastore, switch to a regular one if you want to save a dictionary.
Ordered datastore only accepts numbers.

2 Likes

You have to use httpService:JSONEncode(data) in order to encode it properly for the datastore

For example:

DataStore:SetAsync(player.UserId, httpService:JSONEncode(data))

Dont forget to get httpservice

You don’t have to, it automatically does that on the backend-servers of Roblox.