103: Dictionary is not allowed in data stores

I am trying to dump some data upon a user leaving the game. I’ve done this before without issues - however, I am not sure wat i am doing wrong.

Upon leaving the game, the error 103: Dictionary is not allowed in data stores.

Here is the current code:

game.Players.PlayerRemoving:Connect(function(player)
	local leaderstats = player:FindFirstChild("leaderstats")
	
	local leaderStatsStore = dataStoreService:GetOrderedDataStore("PlayerStats")
	
	local storage = {Coins = leaderstats.Coins.Value}
	leaderStatsStore:SetAsync(player.userId, storage)
end)

Have you tried making it a table instead?

local storage = {["coins"] = leaderstats.Coins.Value}

i would visit this link on error code meanings.
as for what your doing, the error message you have shown is why your script isnt working

I just tried it, however still the same error

An OrderedDataStore only allows for integers (iirc only positive). Swap to using a GlobalDatastore.

8 Likes

Integers is a whole number (not a fractional number) that can be positive, negative, or zero. Examples of integers are: -5, 1, 5, 8, 97, and 3,043. Examples of numbers that are not integers are: -1.43, 1 3/4, 3.14, . 09, and 5,643.1

So Integers aren’t only positive.

I think he meant it only allows positive integers

1 Like

Oh, if that’s the case then just forget about what I said I guess but it’s still good information to know.