Places that are off limits

Hey guys was wondering if I could get some help with this. I am trying to make an event that allows players in an area with specific characters but doesn't allow others to go in there. Example: Player chooses male character and attempts to go into a room not meant for him, but can't go in there. I have four people that the player can choose, but only two of them can go into the specific room.
Here is what i have for one event page, if they don't have a specific person in the party:
1595955586215.png

Here is the event for if they have the specific party member:
1595955632373.png

The one problem I am having is that when I get the specific character in the party the first one still happens and doesn't move onto the others. Any help is appreciated.
whenever a certain event page doesn't happen, the first step should be to check conditions and page priority. Especially if the problem is on page 1 because that is the lowest priority and all other pages come first if their conditions are true.

give each event page a different sprite and check which sprite is visible when playtesting. That will tell you which page is active and allow you to start bughunting there.
Here is the event from page to page:
1595959931492.png

1595959955251.png

1595959974408.png

1595959993416.png

1595960008983.png

When I start the game and switch one is on page 3 goes off, but when I get the specific party member it doesn't go to page 1.
Since page 3 has no condition it will automatically override any other page with a number id less than 3. This means that pages 1 and 2 will NEVER run, regardless of their respective triggering condition.

SOLUTION: make page 3 your page 1 and pages 1 and 2 your pages 2 and 3.
Since page 3 has no condition it will automatically override any other page with a number id less than 3. This means that pages 1 and 2 will NEVER run, regardless of their respective triggering condition.

SOLUTION: make page 3 your page 1 and pages 1 and 2 your pages 2 and 3.
It Worked!! Thank you for your help. Sorry if my problem was kinda stupid, but I am still kinda learning rpg maker.
I'll elaborate a bit more on this for those newcomers that still ignore why Heirukichi told him to change the order of his event pages.

What happens there is that the maker starts reading from the last page, let's say it's 7, till it gets to a page without any conditions, if there's anything like that. (At least that's what actually happened in XP...)

If page n lacks any conditions but page 1 was placed before n, then n will be considered the last page.

It's like pasting a script below Main, it should never be executed. Yeah, that's quite useless indeed. XD

What I usually do is starting from page 1 without any conditions and let it see whether or not it needs to activate other page's conditions. Of course, global conditions can be used if needed, but I prefer not to depend on them from the very beginning but till the local switches get exhausted.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/places-that-are-off-limits.124644/