My Switches to get NPCs to disapepar when you leave the room isn't working

I set a general switch for the NPCs in a room and made a 2nd event page where it's empty. The first page for those npcs have the switches on.

Now I have it on my transfer (for when I leave the room) to turn the switches off but that doesn't seem to be working. After I talk to the NPCs they disappear and when I transfer out of the room they just come back.

What's an easier way for me to achieve this?

Attached are the screenshots
Your description of what happens is consistent with how you've got the events set up.

When you talk to the NPC, you turn on the switch. This then activates the second page with that switch as a condition so they disappear straight away. Then when you leave the room you turn the switch off again, so the first page becomes active and they reappear.

If you want them to disappear when you leave the room, make the transfer event turn the switch on. Don't turn it on in the events themselves.

And unless you want them to reappear in this room at some point, leave the switch on.
I don't understand what you are trying to achieve, but the behavior you are describing fits with the event pages you shown us.

-> The NPCs are there when the switch is OFF.
-> The NPCs disappear when the switch is ON.
-> When you talk to the NPC, it turns the switch ON, thus, making them disappear.
-> Exiting the room turns the switch OFF, thus, making the NPCs reappear when you re-enter the room.
Your description of what happens is consistent with how you've got the events set up.

When you talk to the NPC, you turn on the switch. This then activates the second page with that switch as a condition so they disappear straight away. Then when you leave the room you turn the switch off again, so the first page becomes active and they reappear.

If you want them to disappear when you leave the room, make the transfer event turn the switch on. Don't turn it on in the events themselves.

And unless you want them to reappear in this room at some point, leave the switch on.

I got it! Thanks, so pretty much I can do it this way for events later in the future? Like I can talk to one NPC in a random city and that can change how an NPC interact in a different city?
Just turn on a switch on the "trigger" event, and have another (later) page on the affected event that's conditioned by that switch.

When determining which page to make active, the engine starts from the highest number and works its way back to the lowest number. As soon as it finds a page that either has no conditions, or where all conditions have been met, it makes that the active page. So generally things that you want the event to do early in the game will be on the lower-numbered pages, and things you want it to do later in the game will be on the higher-numbered pages, as their conditions will be met later in the game.
Just turn on a switch on the "trigger" event, and have another (later) page on the affected event that's conditioned by that switch.

When determining which page to make active, the engine starts from the highest number and works its way back to the lowest number. As soon as it finds a page that either has no conditions, or where all conditions have been met, it makes that the active page. So generally things that you want the event to do early in the game will be on the lower-numbered pages, and things you want it to do later in the game will be on the higher-numbered pages, as their conditions will be met later in the game.

I got it to work with the NPCs disappearing when I leave the room but I tried moving the switch so when I enter the room they are gone but that is not working. Are switches only useable on the same map when called?

EDIT: Nevermind, I got it to work

Original thread: https://forums.rpgmakerweb.com/threads/my-switches-to-get-npcs-to-disapepar-when-you-leave-the-room-isnt-working.103798/