MZ How to make certain areas accessible only by certain actors?

I am wondering if there is a way only to make certain areas accessible if that actor is set as the first member in the party.
Any way to make this?
In a Conditional Branch, type this:

JavaScript:
$gameParty.leader().name() == "Reid"
Depending on the game, the team actor's name may change upon joining, either by the player's choice or due to a plot situation, so it would be best to check the ID

$gameParty.leader().actorId() == 1

Check the Database to find the actor's ID and change it

I've moved this thread to MZ Support (from Mechanics Design). Thank you.

Note that you can get the leader's actor ID without scripting:
  • Store actor ID in variable: Control Variables -> Set -> Game Data -> Party: Member #1;
  • Check value of that variable: Conditional Branch -> Variable.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-certain-areas-accessible-only-by-certain-actors.182179/