basically to seperate values and if you want, you can use any symbol you want. table.concat(playerData, “/”) will return: “500/1/Equinox”
In example: if you want, you can use | to separate them, then it will return: “500|1|Equinox”
I also forgot to say if you want to get data back as a table, then you will need to use string.split
Basically like that:
-- if we want to save our data, we need to save it as a string (since datastores can only save strings, numbers and booleans i think)
local playerData = {
["Cash"] = 500;
["Violence"] = 1;
["EquippedKiller"] = serverstorage.Characters.Killers.Equinox.Equinox.Name
}
playerData = table.concat(playerData, "/") -- basically you can change "/" to anything you want
-- but i personaly like to use this symbol
-- if we want to get our data back as a table, then we need to use string.split() and it will return our table that we have saved as a string
local playerData = string.split(playerData, "/") -- if you have used a different symbol, then change "/" to that symbol
This sounds like a bad idea to not maintain a 1FN equivalent, aka bringing data altogether via the form of a string, instead of just keeping a dictionary form. Not only do you need to forget about the keys (you tightly tie data together), but it is also impossible to maintain proper data versioning across time, especially with legacy data you may no longer want to save : you would need to keep the legacy datum, or elaborate some filler techniques.
Relational databases have principles. The 1st normal form tells you that every field should remain atomic. In a nosql db, this principle should be reflected by not doing string manipulations to save data. Dictionaries are the way to go as it removes the dependance of each data that your solution obliges you to endure.
Now the non-UTF8 char issue may be due to either some input in the script, blank character etc, or in the model’s name. I would personally rewrite the entirety of the dictionary, especially if it was written using any LLM. This issue should not happen if the code was written using solely ascii characters.