View Full Version : I need a script. Again.

07-07-2008, 01:00 PM
Does anyone know the basic script i can use (for TSL) that makes an NPC run up to the PC?

Tupac Amaru
07-07-2008, 01:53 PM
void main() {
object oRunner = GetObjectByTag("Kreia");
object oTarget = GetFirstPC();
int bRun = TRUE;
float fRange = 1.0;

AssignCommand(oRunner, ClearAllActions());
AssignCommand(oRunner, ActionForceMoveToObject(oTarget, bRun, fRange));
}Replace the tag of oRunner with the tag of your NPC. The parameter fRange controls how close the character will run up to the PC. You can increase the value so the NPC stops further away.

07-07-2008, 04:44 PM
Thanks. I forgot how to do the GetFirstPC function.