I am receiving an error with saving a player’s inventory to a DataStore. My error is 104: Cannot store Dictionary in DataStore. According to the Datastore Errors page (also, can Roblox decide on DataStore vs. Datastore?), error 104 has to do with trying to store too large of an object in the DataStore. But that limit is massive, and I was very confused as to how I could have possibly hit that. So I decided to encode my tables to JSON and print that result just to see how large they were getting, and that has left me even more confused. Here is the JSON’d table that is causing problems:
I’ve already open-sourced all the code You can get the component here. For the record though, here is the specific set of lines that are causing the problem:
It does - but I know for a fact that storing dictionaries is fine. I don’t think I’ve ever used DataStores for anything other than storing dictionaries.
I have not yet. I easily could, but I’d like to first see if I was doing something wrong and save that as a last resort.
local Data = [[{"EquippedItems":{"ItemType_9":[{"Metadata":{"VertexColor":null},"ItemID":"{52444A68-DB71-4806-991D-151EB986D1E7}"}]},"ItemType_9":{"{52444A68-DB71-4806-991D-151EB986D1E7}":{"NumberOwned":1},"{69AECD51-0212-4249-9EE5-1CD6E61CE0B7}":{"NumberOwned":1}}}]]
game:GetService("DataStoreService"):GetDataStore("test"):SetAsync("hi",game:GetService("HttpService"):JSONDecode(Data)) <- turns the data into a table