But I figured this would cause lag and use up the limits on saving in the datastore. However I’ve been running into error 104. What could I do to fix this?
Can you try looping through all of the stats and check if any of them are nil?
a person had this issue not long ago and the cause was a nil value
if you dont want to loop through it you can also turn the dictionary into a json and save the json,
then when you load turn the json into a dictionary again and use that as the data
You can’t save userdata values. Go through all of your stats you’re saving, and print(type(stat)). If it prints userdata then you’ll have to save that value differently.
I would just make a function to serialize the userdata and turn them into tables, and another function to create the userdata from the raw tables. For example, a CFrame serialize:
function serializeCF(cf)
return {cf:GetComponents()}
end
function makeCFFromRaw(rawCF)
return CFrame.new(unpack(rawCF))
end
Edit: I don’t know whether this is better than a JSON approach or not, I haven’t looked into it much.