Saving Backpack/Inventory/Tables

I’m creating a rogue like game and I want it to work around a perma death mechanic. The best an easiest way to explain what I want would be Rogue Lineage’s inventory save system. If you haven’t heard of rogue lineage I’ll explain what I want.

Basically I want to save the player’s backpack when they leave the game and load it when they re enter. The way I would go about this is saving a table of the item names in your inventory and then loading that table when you rejoin, upon rejoining the script will look through a folder which contains all the games tools and clone them into your inventory. Of course this is how I would do it and I’m not sure if this is effective. I also am unsure of how to save a table to datastores as opposed to things like values.

On top of this I also want the inventory to reset when dying which shouldn’t be a problem if using the default roblox backpack but I know some people use folders as an extra inventory type thing.

Any help would be appreaciated, whether that be explaining how I could do it my way or offering an entirely different route :smiley:

(PS: I know I asked for saving inventory and the worry that equipped tools will not be save may pop into your head but I think you could simply remove the tool from the character and insert it into the backpack before saving.)