View Single Post
  #7  
Old 06-05-2012, 01:29 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
If you're moving the npc on the server-side you need to use findnearestplayers or some other kind of loop and a bounds check like callimuc has posted. I.e.

PHP Code:
for (temp.pplayers) {
  
with (temp.p) {
    if (
this.x in |player.xplayer.x+3| && this.y in |player.yplayer.y+3|) { 
      
player.chat "The NPC touched me!"
    } 
  }

__________________
Quote:
Reply With Quote