Overwriting tables has always been on my mind for some time. I wanted to know if overwriting tables in this manner would be feasible and wouldn’t lead to potential issues.
local A = {Test = true, Class = "Sword"}
local B = {Test = false, Class = "Dagger", Skills = {Slash = true}}
A = B
Now I’ve tested this out and it does actually work. However, I can’t help but feel that somehow some things would be missing or incorrect.
Sure, I could manually do this:
A.Test = false
A.Class = "Dagger"
A.Skills = {Slash = true}
But this isn’t convenient. I’m using Profile Service as a means to store data in my game but it saves based on tables, and not folders, values, etc. This means I have to serialize my player folder and convert it into something that could actually be saved. The only issue is that this would be a very tedious process of making sure everything is properly aligned, especially if some values get deleted, added, or moved around.