Easy question: Storing Actor Id on Party Member position BEYOND 8 party slot.

Hi all!!
This should be easy but I dont get the code right.

One can use the Control Variables , Game Data, Party Member 1 through 8 slot to store the actor Id on a variable depending on its position on the party. If I wanted to store the ID for a 9th or 10th player, I should use a script code. What would that code be?
I have:
Code:
$gameVariables.setValue(X,  $gameParty.members()[9].actorId());

But of course, is wrong. Any help?

Thanbks!!
What's the problem with that code, aside from it not getting all members but a list depending on whether you're currently in battle?
What's the problem with that code, aside from it not getting all members but a list depending on whether you're currently in battle?

Funny, The code is right. The thing is I dont have a party member in slot 9, since party index starts at 0, not 1. If i have an actual member on the slot, it will return the data with no problem.

Thanks for answering though!!
Oh, so you just want a placeholder ID instead if you don't have that many members?

Original thread: https://forums.rpgmakerweb.com/threads/easy-question-storing-actor-id-on-party-member-position-beyond-8-party-slot.87930/