Lose Money on Death

I've been working on a game recently, and made a bank. It's there to keep your money so you don't lose it on your death, but I can't find a way to make you lose gold on when you die.
if you have evented battles only, you can check the "can loose" on battle processing for that.
if you have random battles, you'll need a script to redirect the game over sequence.
if you have evented battles only, you can check the "can loose" on battle processing for that.
if you have random battles, you'll need a script to redirect the game over sequence.
Do you have the script, or could you tell me where I need to edit?
don't edit - use a script.
and I know the script is on the Ace master script list, but I don't have a link to it.
Not sure if you're still looking for something, but I just whipped this up. It lets you run a common event after battle if you lose, rather than going to the game over screen. In the common event, you can set up the party losing gold, etc.

Code:
module RevivePlayer
  CommonEvent = 5 # change this number to the ID of the common event you want to run
end

module BattleManager
 
  def self.process_defeat
    $game_message.add(sprintf(Vocab::Defeat, $game_party.name))
    wait_for_message
    revive_battle_members
    replay_bgm_and_bgs
    $game_temp.reserve_common_event(RevivePlayer::CommonEvent)
    SceneManager.return
    battle_end(2)
    return true
  end
 
end

It may not work if you have other scripts that alter the battle scene.

Original thread: https://forums.rpgmakerweb.com/threads/lose-money-on-death.96817/