When player joins again, Im reading that datastore and saving that data into a module table
Players_DATA.InGame = {} -- Module table
-- This is done when reading the datastore, creates a key based on the player id
-- and place the datastore data into that dictionary, "looks like this"
Players_DATA.InGame[player.UserId] = "The data gotten from Datastore"}
When I take that module table and try to save it again into a datastore, it says I cant store a dictionary. DB:SetAsync(ply.UserId, Players_DATA.InGame[player.UserId])
I made this process lot of times before, I mean, reading a datastore, saving that on a module table, letting player to update the values into the module table while playing, and when player leaving using that module to overwrite the datastore of the player, always works, but this time is not, the only difference is that this âdictionaryâ is a little bigger than previous ones I used, and I have more keys into the module table, but, Im accessing the right one I wanna save.
I know its a dumb question, but, what am I doing wrong?
Is there an error message? If youâve done this before (and I think Iâve done similar) it seems to probably be a bug somewhere in this implementation, could you share the code?
The only error is this one: not saved 104: Cannot store Dictionary in data store. Data stores can only accept valid UTF-8 characters.
I could bring the code, but its a lot and doing more stuff around the issue.
I could bring the important parts, but, Im sure the original post contains the important.
But yup, maybe Im saving into the module something incorrectly⌠Thats the only thing I can imagine
yup, Im printing everything before perform any saving, update etc.
Before trying to save into datastore Im printing the table to save, and its the right one, and its exactly the same as when player joined and got it extracted from player datastore, its the same as in the module too, and the right one when trying to save into datastore, but still, same error
Its just the same table at the beginning, on every print, it got saved first time into datastore, then readed from datastore after some time and stored into a module for some time, then tried to save it again into datastore and thats when error occurs
yup, theres other functions that writes into the module, but Im not using those functions, just directly into saving cycle testing, at the end before trying to save its printing normally, as it was since the beginning.
Im creating another place in order to test it carefully, just the cycle
I tested it in another place and works great⌠But I deleted a step on the edition of the module. Im reading a humanoid description and saving the IDs in some parts of the table that is on the module. By disabling that step the table hierarchy is saving perfectly as it should do⌠seems that Im breaking somehow the ânormal tableâ when editing it and adding the HumanoidDescription idsâŚ
oh no problem, Im not mixing indexes. âpropertiesâ etc, Im messing something during the edition of the table gotten from datastore, the weird thing is both tables looks exactly the sameâŚ
When disabling this line, works normally.
I guess Im not saving proper data when using currentDesc[a] Players_DATA.InGame[tostring(ply.UserId)]["Av_Presets"]["P01"]["HumData"][a] = currentDesc[a]
ohh!! great, yup, that was the issue⌠now works great, sorry for making you waste time⌠I turned all values gotten from the HumanoidDescription into tonumber() and now datastore saves normally⌠oops sorry :v
yup, but BodyPartColors is a Color3 instance, so its not possible to save it on a datastore if you dont convert those values into a table. I was not aware of that