MV How to get the party member value in a variable to a script call

I'm trying to get a script to open the equip menu for the actor in the first slot but i can't find how to get the value of the party members from a variable into the script so it opens the first party member's equip menu

Here's my current script:
Spoiler
1686905538317.png
I want to change the "6" which always opens actor 6's menu, into instead opening the first actor in the party using variables. That's what i'm trying to do

I'm not sure if using a variable even is the best way of doing things but that's the only way i could think of doing it
JavaScript:
$gameParty.setMenuActor($gameParty.members()[0]);
SceneManager.push(Scene_Equip);

Edit: or you could use Control Variables -> Game Data -> Party -> Member #1 to store their actor ID in a variable, then do:
JavaScript:
$gameParty._menuActorId = $gameVariables.value(123);
SceneManager.push(Scene_Equip);
...where 123 is the ID of the variable you used.
JavaScript:
$gameParty.setMenuActor($gameParty.members()[0]);
SceneManager.push(Scene_Equip);

Edit: or you could use Control Variables -> Game Data -> Party -> Member #1 to store their actor ID in a variable, then do:
JavaScript:
$gameParty._menuActorId = $gameVariables.value(123);
SceneManager.push(Scene_Equip);
...where 123 is the ID of the variable you used.
Ah, the second method was the one i was trying to do

As I'm not too familiar with Javascript i just wanted to be sure, does the 0 in the first method refer to the first party member? Would i then use 1 for the second party member, 2 for the third and so on?

Edit: I realise in hindsight i could've just tried the code and see if i was correct, sorry, it does work perfectly thanks
does the 0 in the first method refer to the first party member? Would i then use 1 for the second party member, 2 for the third and so on?
Yes, that's correct. 👋

it does work perfectly thanks
Great, you're welcome! Happy RPG Making~

Original thread: https://forums.rpgmakerweb.com/threads/how-to-get-the-party-member-value-in-a-variable-to-a-script-call.158381/