I used the example Datastore code as a foundation, but I noticed that if you ever want to add or remove values from the retrieved data that it get's a little tricky. Ex.
sessionData[player] = {SBBplayerSettings = {apples= false, toOranges= false}, pearsAreOktoo = false}
When a new player joins, their data will be created to have this setup. However, if a player had joined before the update, when retrieving their data it may look more like this:
sessionData[player] = {"Experience" = 0, "Money" = 0}
I have no idea how to pull the old strings/tables and convert them to the updated format. I have however tried something like this (there is code before this that worked at figuring out which pieces are missing which is not included)
if firstTimeEntry == false then
for key,value in pairs(dataWork) do -- dataWork is the table (dataWork = {data}) --(I moved it to the table dataWork in order for it to run smoother.) for keyA,valueA in pairs(value) do -- My attempt to add a key to data inside dataWork firstTimeEntry = true print("made it to the table") table.insert(value, firstTimeEntry) print("made it past") firstTimeEntry = true print(keyA,"=",valueA) end end
end