I had noticed that people lost their save files because they couldn’t undo their massive creations they overwrote by accident, so i went to check it out and noticed that table.unpack has a limit.
Why is there a limit for table.unpack and is there a way to bypass it? People are risking on losing their massive creations they have been working on for weeks.
You shouldn’t be using table.unpack() in the first place for this sort of application, what are you passing the returned tuple to? Some code would be appreciated.
This doesn’t help me, what is content? I think you may want to look into Serialization, converting part objects into data storable in DataStores. I’m not an expert on the topic but this is how one of my friends solved a similar problem.
The saving table will be saved once the player leaves the game.
The backuptable gets loaded onto the craft from the saving table once the player presses the undo button and the current craft from the saving table will get moved to the backup table.
It sounds to me as if table.unpack() is not a viable method for this. As @LukaDev_0 suggested you should be looping through rather than using unpack and passing everything to a new table.
local cloneTable = {}
for k, v in pairs(PlayerData["Slot"..tostring(SlotNum)].Craft) do
cloneTable[k] = v
end
PlayerData["Backup" .. SlotNum] = cloneTable