Removing all items from the party then giving the same items back

Let me start off by saying that I am uncertain if this is the correct forum to ask this but maybe it is, if so cool 😀...


So here is my situation : In my rpgmakermv game the main character will find himself in a dungeon where he will get some items . Once he gets out of said dungeon


I need to remove everything he gathered/equipped. Easy enough up to this point but here is where I am having some trouble as to how to proceed : Later in the game he will 


go in another dungeon where I want him to get back all the items that I took from him from the first dungeon.


Since I can't know the exact items the player might have gotten from the first dungeon 


I can't just give him a set number of said items. As such I need a way to take at some point A of the game all the items he has and then at a next point B give him back the exact items he 


had at  point A. I hope I am clear and that you can help me out. Thanks in advance!
Have switches and variables corresponding to what items they have. For example, Conditional Branch: If Item "Potion" is in Inventory, Control Switches "Potion" ON, then in the same branch, Control Variables = # of Potion in inventory. (that can be found under "Game Data"). Then later in the game, you can call a Conditional Branch to check if the switch "Potion" is on. If that's on, Change Items --> Increase --> Variable: "Potion". It's really convoluted, but that's how these things work if you want them to be good.
Set aside a variable for each item, weapon, and armor. Then at the end of the dungeon put a bunch of "set variable" commands, each set to Game Data > # of [insert item/weapon/armor here]. At the beginning of the next dungeon, add Item/Weapon/Armor and set the amount to "variable", then choose the variable corresponding to the particular item/weapon/armor. Similar to what the first poster said but no need for the switches. If the variable was 0 then there will be no items added - no worries there.
Thank you both for your quick answer, it's quite late atm so I won't test your methods quite yet but I really appreciate the time you took to help me out.


I'll let you know if I am successful tomorrow! 
Hello guys! So I tried your methods and here is the exact way I did it : First I created all the variables for each item + equipment + gold. Then when a specific event happened at 


the end of the dungeon I put a conditional branch which said : Conditional branch if Gold greater or equal to 0 Control Variable Gold = Gold , Change gold = -99999 , Control Switch : Gold Switch = On . That removed the gold and stored the amount the player had and then at a later stage of the game I added the conditional branch : If Gold Switch is ON , Change Gold :  {Gold} ,Control self switch A = On , End of conditional  Branch. I think that should be the end of my problem (I hope so at least 😛). Once again I would like to thank you both for helping me out! 

Original thread: https://forums.rpgmakerweb.com/threads/removing-all-items-from-the-party-then-giving-the-same-items-back.57641/