How to erase npc in event?

Hi! I'm new to rpgmaker and currently struggling with an event I'm trying to make.
At the end of the event, there are npcs that walk away and to make them actually be gone I tried using a control switch (Event is activated on auto run, npcs are own separate events) :
Code:
Fadeout Screen
Control Switches : #0001 = ON
Fadein Screen
Control Self Switch : A = ON
And then the npcs codes are just erase event with the switch 1 condition checked
But when I go to playtest, the npcs are gone right off the bat. There are no other events that have ever turned switch 1 on. Help 🙁 Sorry if there are any important details I didn't mention!
Are all your commands controlling the NPC events ON the NPC events themselves, or in the autorun event? It might be as simple as turning on the Wait for Completion flag on the last move route. If that doesn't work, show an actual screenshot of your controlling event, and of one of your NPC events.

Another possibility is that your NPC events have multiple pages, and a higher numbered page has no conditions and no sprite - did you remember to put switch 1 as a condition on the second page?
It's pretty confusing to try to decipher the sequence without actually seeing the events. Your best chance at getting help is to post screenshots of all events involved. That being said:

I tried using a control switch (Event is activated on auto run, npcs are own separate events) :
This makes it sounds like you have an autorun event with that code, which...yes, will automatically run immediately upon going into the map. So the NPCs will be gone immediately.

And then the npcs codes are just erase event with the switch 1 condition checked
There's no reason to have an erase command. Just make the page with the switch condition be blank.
It's pretty confusing to try to decipher the sequence without actually seeing the events. Your best chance at getting help is to post screenshots of all events involved. That being said:


This makes it sounds like you have an autorun event with that code, which...yes, will automatically run immediately upon going into the map. So the NPCs will be gone immediately.


There's no reason to have an erase command. Just make the page with the switch condition be blank.
Turns out they did have autorun on, but also it turns out I needed to make a second page with the condition checked, oops skull emoji
Tysm for the help!
Are all your commands controlling the NPC events ON the NPC events themselves, or in the autorun event? It might be as simple as turning on the Wait for Completion flag on the last move route. If that doesn't work, show an actual screenshot of your controlling event, and of one of your NPC events.

Another possibility is that your NPC events have multiple pages, and a higher numbered page has no conditions and no sprite - did you remember to put switch 1 as a condition on the second page?
I did forget to put the condition on the second page, too bad I saw this too late haha TY THO

Original thread: https://forums.rpgmakerweb.com/threads/how-to-erase-npc-in-event.153679/