Zelda-eqsue return to dungeon entrance death thing?

So, I'm looking for a script that will return the player to a specific location upon death.

What I need is, at basic, it returning the player to, say, a cathedral on death.

For more complex, it would need to return the player at the beginning of the dungeon, or checkpoints.

(Sorry for weird sentence structure, I just woke up and am still a bit loopy from sleep.)
Yes!

Need this!

*follows topic*

...

...

*googles script*
I believe there is a script which will run a common event on death. Could you use that and set the common event to return you to the dungeon entrance, depending on which dungeon you are in?
If you mean in battle that is easy, no script necessary.

When you setup the battle process make sure "continue after defeat/death" (I forgot what its called exactly) is on. 

Then inside the battle process script where it says "if defeat" put a Transfer event in, and choose the event entrance as the target. 

Whats not so easy: Knockout from floor damage.
@LexnNitro

that would only work if it's an evented battle.  If it's a random encounter you can't do that as there is no Battle Processing command.  The OP hasn't specified which it is.

@Diretooth

could you specify, therefore, whether it's evented, random, or a mixture?
Would this work?

Spoiler
Code:
module SAR  module TRANSFER_VARS    MAP_ID = 200 #varible id    X = 201 #variable id    Y = 202 #variable id    D = 203 #variable id direction the player is facing  endendmodule BattleManagerdef self.process_defeat    $game_message.add(sprintf(Vocab::Defeat, $game_party.name))    wait_for_message    if @can_lose      revive_battle_members      replay_bgm_and_bgs      SceneManager.return    else      SceneManager.return      transfer    end    battle_end(2)    return true  end    def self.transfer    revive_battle_members    $game_player.reserve_transfer($game_variables[SAR::TRANSFER_VARS::MAP_ID], $game_variables[SAR::TRANSFER_VARS::X], $game_variables[SAR::TRANSFER_VARS::Y], $game_variables[SAR::TRANSFER_VARS:])  end  end
Well, I'd like it if after any kind of battle, evented or not, the player would return to the dungeon entrance, except in certain situations. However, given that I plan on having all random battles be evented, I could figure out a way to implement this without a script, (Thanks to LexnNitro.) Thank you all, I appreciate it.

Original thread: https://forums.rpgmakerweb.com/threads/zelda-eqsue-return-to-dungeon-entrance-death-thing.42496/