Lgn_n
(Logan)
April 7, 2020, 6:15pm
#1
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
Lgn_n
(Logan)
April 7, 2020, 6:18pm
#4
I just tried it, however still the same error
kingdom5
(kingdom5)
April 7, 2020, 6:19pm
#5
An OrderedDataStore only allows for integers (iirc only positive). Swap to using a GlobalDatastore .
8 Likes
Nerkonl
(Nerkonl)
April 7, 2020, 8:00pm
#6
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
Nerkonl
(Nerkonl)
April 7, 2020, 8:03pm
#8
Oh, if that’s the case then just forget about what I said I guess but it’s still good information to know.