Jump to content
  • 0

Player Detecting NPC :P


Nash

Question


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   0
  • Joined:  02/17/12
  • Last Seen:  

Hi guys,
i wanna make a script 
that uses npctalk if  a players is around the npc

like npc says hello if player passes :P

please write a sample Script so ill know how to do it :P


Thx for all your help guys

Regards,
Nash

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

Just to give you an idea, you can use the OnTouch/OnTouch_ event.

OnTouch:

This label will be executed if a trigger area is defined for the NPC object it's 
in. If it isn't present, the execution will start from the beginning of the NPC 
code. The RID of the triggering character object will be attached.

OnTouch_:

Similar to OnTouch, but will only run one instance. Another character is
chosen once the triggering character leaves the area.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

please write a sample Script so ill know how to do it :P

hmm ........... hmmmm........

prontera,150,189,5	script	AnnieRuru	123,5,5,{
	end;
OnTouch:
	npctalk "Hi "+( ( sex )? "Handsome" : "Pretty" )+" one ~ How may I help you ?";
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   0
  • Joined:  02/17/12
  • Last Seen:  

ontouch works if players touches npc right?

guys i want it like it would say that even if Player is in 3-4 cells away ^^
is it possible to do so?
if yes . how?

Btw thx for reply guys ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

Read The F***ing Manual

 

prontera,150,189,5	script	AnnieRuru	123,3,4,{
	end;
OnTouch:
	npctalk "Hi "+( ( sex )? "Handsome" : "Pretty" )+" one ~ How may I help you ?";
	end;
}
this will trigger the npc with the range like this

xxxxxxx

xxxxxxx

xxxxxxx

xxxxxxx

xxxNxxx

xxxxxxx

xxxxxxx

xxxxxxx

xxxxxxx

https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L224

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...