Enemy appears after taking a key

So, guys, Im making a demo of a horror game and I want that, after my character obtain a key to unlock the door, an enemy appears right in front of it(the door).


Im still newbie to RPG Maker and I have no idea how to do it. This is very important to me because I have to deliver this project next friday(23).
Add a switch as a condition on your enemy event (above the event sprite, not in a conditional branch).  When you obtain the key, turn on the switch.
Add a switch as a condition on your enemy event (above the event sprite, not in a conditional branch).  When you obtain the key, turn on the switch.



You mean the switch with numbers 0001, 0002...?
yep.


Follow the Starting Point for New Users banner in my signature.  This is very basic stuff and you will need to have a good understanding of it asap.
Yep, I did it. Now I have one last question in this thread: how can I make the enemy disappear after I leave the map(by the unlocked door)?


I want the enemy to be gone when I return to the map where he first appears.
Make any and all events that allows the player to leave the map turn off the switch that was used to activate the enemy.
Milennin, I did what you said, but the enemy is still there when I go back to the map.
Show us what you did.. If that monster event is activate via a switch then if you follow milennin's suggestion of turning off that switch, then the monster event should be gone.
unless the event where you turned the switch on is set to parallel process and you never 'ended' it properly.
The enemy appears after I obtain the key from the chest:
Event_Chess_1.png



Event_Chest_2.png



The enemy:


Event_Enemy.png
I want that, after entering this room and going back to the former(the room where the enemy appears), the ghost disappears:


Hallway.png
You need to make your door events disable that switch.
which is exactly what Milennin said immediately after that question was asked.
You need to make your door events disable that switch.



But in what page of the event? This is the door:


Door_Hall.png



Door_Hall_2.png
which is exactly what Milennin said immediately after that question was asked.



But when I disable the switch(after transfering the player) and go back the map, the event(taking the key, enemy appears and unlock the door) happens again.
because you have the second page conditioned by that switch AND self switch A.  It doesn't need to have both.  It only needs the Self Switch A condition.


My post 15 hours ago suggested you look at the 'starting point for new users' banner in my signature.  I assume you didn't, because if you had, you would have found some material on events with multiple pages and switches and realised already that's why it's happening.

Original thread: https://forums.rpgmakerweb.com/threads/enemy-appears-after-taking-a-key.72421/