Jump to content

Home

How do you get a npc to talk to you through the onenter= spot?


randydg

Recommended Posts

Originally posted by randydg

How do you get a npc to talk to you through the onenter= spot?

 

OnEnter event of what? The Module, the Area or a trigger?

 

Does the NPC already exist near where the player enters, or does it need to be created?

 

What's the Tag of the NPC?

Link to comment
Share on other sites

OnEnter event of what? The Module, the Area or a trigger?

 

Does the NPC already exist near where the player enters, or does it need to be created?

 

What's the Tag of the NPC?

 

tag=doctor1

 

you made the script for me awhile back but i lost it and sence the forums lost a few weeks thread, i can't find it here.

 

and yes, npc exists near pc.

Link to comment
Share on other sites

Originally posted by randydg

tag=doctor1

 

you made the script for me awhile back but i lost it and sence the forums lost a few weeks thread, i can't find it here.

 

and yes, npc exists near pc.

 

Since you didn't say what kind of object it is supposed to be an OnEnter script for, I assumed it was for the area in the below script.

 

I think this should work:

void main() {   
   if (GetIsPlayerMadeCharacter(GetEnteringObject())
       && !GetLocalBoolean(OBJECT_SELF, 40)) 
   {
       SetLocalBoolean(OBJECT_SELF, 40, TRUE);
       object oNPC = GetObjectByTag("doctor1");
       NoClicksFor(2.0);
       DelayCommand(2.0, AssignCommand(oNPC, ActionStartConversation(GetFirstPC())));  
   }
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...