$gameParty.members().forEach(function(members, index){ if($gameActors.actor(X) == members) $gameVariables.setValue(Y, index);})
$gameParty.members().forEach(function(members, index){ if($gameActors.actor(X) == members) $gameVariables.setValue(Y, index); })