MZ SceneManager script call question

Hi, I'm trying to use the following script to access the menus.

SceneManager.push(Scene_Status);

The thing is, when I call the status or skill menus, I get some errors if the selected menu hasn't been accesed before manually. Is there a way to set the last selected actor? I've been trying to read the core scripts in order to look for a way to do this but to no avail.
1641255348407.png


Pic is what I get when I try to access the status menu by a common event without entering it first during a game.
Try a script call like this:

const actor = $gameActors.actor(1); // actor ID 1 $gameParty.setMenuActor(actor); SceneManager.push(Scene_Status);
If you want to reference an actor by their position in the party instead, you can replace the first line with something like this:

const actor = $gameParty.members()[0]; // position 0 (leader)
You can find a lot of handy script calls listed here:

Original thread: https://forums.rpgmakerweb.com/threads/scenemanager-script-call-question.143583/