How do I make it so that after a battle, it'll teleport the player to another area

I'm pretty new to rpg maker in general so i'm not entirely sure what i'm doing. But what i'm attempting to do, is make it so that after a rare enemy encounter, it teleports the player to a hidden area. But instead of doing that, the player stays in the same room. Please help ;-;

- A new user

1652570356599.png
1652570402506.png
Should change "Don't Run" to turn 0 + 1

I believe it'll work but I've never done this. Might be best to wait for a more experienced helper.
That's a really neat idea. Hopefully you get it to work. I wouldn't mind messing around with puzzles that involve killing certain enemies and escaping from certain enemies.
Your first problem is, as @JacSkulls mentions, that your condition to run the event is set to 'don't run that event'. You need to change to something like 'run every turn' and then in your event insert a condition so it only actually does something if the enemy is defeated.

However there is an additional pitfall. Per default, the game engine immideately ends the battle after the last enemy is killed. So your transfer event still won't run. There are two possible work arounds:
in the default editor you can apply an invisible immortal state to the enemy and then in the transfer event you also temove that state and queue the transfer.
Or you could use a plugin like https://himeworks.com/2015/10/end-phase-triggers-mv/

All these extra steps of course only apply if you need to do this via battle events (for example because the enemy is intended for the random encounter tables). If you use an on-map event to visually show the enemy, you can simply insert the transfer command after the battle processing command in that map event.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-it-so-that-after-a-battle-itll-teleport-the-player-to-another-area.147600/