[VX ACE] Exit Menu, Delete Actor

Hello there,
I'm not really good in scripting so, is there a way to delete an actor from the party every time I exit the menu screen using scripting?
Moved to: RGSS3 Script Requests

What actor? How do they get into the party? More context please.
Actually it's more like, I want something to happen/common event whenever I exit the menu window.

EDIT:
Oh wait, I actually figured it out already xD
how did you do it?
I found this: https://www.rpgmakercentral.com/topic/26372-common-event-after-menu-exit/

and then instead of calling common event, I use this:

Code:
partyMem = $game_party.members
$game_party.remove_actor(partyMem[1].id)

to delete the second member in the party.
Is there always going to be second member in the party when you exit the menu?
Is there always going to be second member in the party when you exit the menu?
Yep, I also add members everytime I open the menu.
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-exit-menu-delete-actor.142416/