How to add actor based on Varaibale?

I think I will need script buy I'm not sure.
You could use Conditional Branch commands, e.g.
Spoiler: Event example
Code:
◆Comment:Set variable value (for testing)
◆Control Variables:#0001 Actor ID = 1
◆Comment:Check variable value and add appropriate actor
◆If:Actor ID = 1
  ◆Change Party Member:Add Harold
  ◆
:Else
  ◆If:Actor ID = 2
    ◆Change Party Member:Add Therese
    ◆
  :Else
    ◆If:Actor ID = 3
      ◆Change Party Member:Add Marsha
      ◆
    :Else
      ◆Comment:etc
      ◆
    :End
    ◆
  :End
  ◆
:End

Or a single Script command:
JavaScript:
// Get actor ID = value of game variable 1
var id = $gameVariables.value(1);
// Add that actor to the party!
$gameParty.addActor(id);
Change the 1 to match the ID of your game variable.
Thank you so much!It works perfectly!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-actor-based-on-varaibale.127965/