Jump to content

Home

Trying to script an NPC into an area...


Recommended Posts

I'm trying to script an NPC into an area, but it's not working. Here is my script:

 

void main() { 
object oEntering = GetEnteringObject(); 
object oPC=GetFirstPC(); 
if (GetIsPC(oEntering)) 
{ 
CreateObject(OBJECT_TYPE_CREATURE, "IG76", Location(Vector(329.98,167.30,26.42), 0.0)); 
ExecuteScript("old_k_ptat18aa_enter", OBJECT_SELF); 
}
}

 

What am I doing wrong?

Link to comment
Share on other sites

Did it compile for you? 'Cause if that's all that's wrong then I know your problem... I got it to compile for me... chances are you probably won't notice the difference, cause it was just a minor change, but your "{" symbol doesn't need to be on the same line as "void main()"...

 

So try this instead:

void main() 
{ 
object oEntering = GetEnteringObject(); 
object oPC=GetFirstPC(); 
if (GetIsPC(oEntering)) 
{ 
CreateObject(OBJECT_TYPE_CREATURE, "IG76", Location(Vector(329.98,167.30,26.42), 0.0)); 
ExecuteScript("old_k_ptat18aa_enter", OBJECT_SELF); 
}
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...