Random Party Member Selection

Is there a way to select a party member by their party member # (not their ACTOR ID) in the current party?

I want to make a variable that equals [party member #], not actor ID but their current position in the party. Not to check based on Actor ID of party member #x but to choose a random party member #.

What I want to make:

[party member #] = [random 1-4] = A

Trigger event x if A has actor ID y.


There doesn't seem to be that option without scripting and the script call for it doesn't seem to be in list of script calls in the Google Doc ().
use script from event tab 3 and try
Code:
var actorData = $gameParty.members()[Math.floor(Math.random()*$gameParty.members().length)];
$gameVariables.setValue(x, actorData);

and you get object of random party member stored in your variable.
You can try to run this code in console and see wich properties and methods you can
obtain with it. (example)
use script from event tab 3 and try
Code:
var actorData = $gameParty.members()[Math.floor(Math.random()*$gameParty.members().length)];
$gameVariables.setValue(x, actorData);

and you get object of random party member stored in your variable.
You can try to run this code in console and see wich properties and methods you can
obtain with it. (example)

Assuming that the script successfully pulls a random party member #, I'm still currently stuck at where I'm trying to connect random party member with actor ID, where AFTER random party member # is determined, if I want to check which Actor ID the random party member has, in order to activate an effect (just a Show Text for the test) that is unique to each Actor ID, depending on who the random party member is.
For party members (characters that follows leader) would be following code:
Code:
$gamePlayer.followers().follower(Math.floor(Math.random()*$gameParty.members().length));

Original thread: https://forums.rpgmakerweb.com/threads/random-party-member-selection.113743/