Jump to content

Home

Make an NPC exit (move to a location and vanish)


Veldrin

Recommended Posts

void main () {

 // goodbye.nss

 // This script will make any NPC 
 // move to a desired location and vanish.

 object oNPC=GetObjectByTag("Carth");    // insert NPC's tag here

 float x=93.77;                         // do a whereami cheat
 float y=141.06;                        // to get x, y, and z
 float z=0.0;                        

 int bRun=FALSE;                         // you can set this to TRUE
                                         // if you want the NPC to run


 vector vExit=Vector(x,y,z);
 location lExit=Location(vExit,0.0f);
 ActionDoCommand(SetCommandable(TRUE,oNPC));
 AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));
 AssignCommand (oNPC,ActionDoCommand(DestroyObject(oNPC)));

 // you can omit this last command if you like --
 // if the NPC is not able to move to the
 // location, this command will prevent
 // you from being able to speak with him
 // again.   But if they're going to leave anyway...

  ActionDoCommand(SetCommandable(FALSE,oNPC));

}

This script has been tested on Carth in the "Hideout" when first arriving on Taris.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...