How to lose items and money on game over

Not much too much to elaborate on from my title. but I'll make a few things a bit clearer. What I want is that when the player receives a game over, they will lose random items (excluding key items, armor and collectables) and a percentage of money. Is there any way to do this?
You can achieve this with a plugin, a couple of variables and some eventing. First, add Hime's Game Over Events plugin into your project. Now when the player dies instead of kicking them back to the main menu, it'll play a common event and you can customize it from there. Now make two variables: One for grabbing the ID of items and another for random numbers. Now for the item variable, you'll have it pick a random number from whatever the starting of your consumable items start to the end of them. Create conditional branches that will correspond to the item ID variable's random numbers. You'll make one for each item. Inside those branches have the second variable run a random number for how many items you want the player to lose. Under that place the item for that branch and have it decrease by the second variable. Now you have the basic setup for losing random items.
For money, you can do that with a single variable. Create a Gold Check Variable and have it check the party's current gold amount. Then multiply that variable with the percentage number you want taken away. Now divide that variable by 100. After that set up the Change Gold to take away gold by the amount of that variable.
Alright thanks, it worked.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-lose-items-and-money-on-game-over.116026/