Jump to content
  • 0

Question

Posted

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!

 

 

1 answer to this question

Recommended Posts

Posted

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...