Jump to content
  • 0

Calling a 'mes' from another NPC using donpcevent,


grobyczen

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  04/07/13
  • Last Seen:  

Hello everyone,

 

I need help figuring out how to make a message and menu stored in a NPC (lets name it 'Source NPC') show in another NPC (lets name it "Caller NPC").

 

I have already tried this:

 

///////////////////////In "Source NPC":

 

 

OnOferta:

mes "Hey man";
switch (select("message received")){
case 1:
 mes "Nice";
 close;
}
 

 

 

 

///////////////////////////In "Caller NPC":

 

 

mes "'Sup";
switch (select("try to get the message")){
case 1:
 donpcevent Source NPC::OnOferta;
}
 

And when I try to get the message I get the following error:

 

[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Function: mes (1 parameter):
[Debug]: Data: string value="Hey man"
[Debug]: Source (NPC): Source NPC at gef_tower (159,54)
 
Can anyone explain me why this is happening, and how could I solve this problem?
 
Thanks in advance. (And sorry for my english. Not my first language.)
 
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

Try using doevent

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

One main difference between the two commands is that Doevent keeps the player attached while Donpcevent will never attach an RID.

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  04/07/13
  • Last Seen:  

Solved.

 

Thank you  Joseph & Euphy.

 

Worked like a charm.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...