Jump to content
  • 0

Checkcell npc


ToiletMaster

Question


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Hi guys,

 

This is a funny request as... currently if let's say you're 5 cells away from the NPC.


It'll state "you're not close enough"

 

but once you're 5 cells within the npc,

it'll state something else.

 

Is it possible to make this up? Thanks!

 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2351
  • Joined:  10/28/11
  • Last Seen:  

try this

 

getmapxy( .@npc_map$,.@npc_x,.@npc_y,1 );
getmapxy( .@player_map$,.@player_x,.@player_y,0 );

if( distance( .@npc_x,.@npc_y,.@player_x,.@player_y ) > 5 ){
    mes "You are 5 cells away..come closer.";
}else{
    mes "You are near to me..";
}
close;
 

 

 

refer  getmapxy , distance

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