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.p: players) {
with (temp.p) {
if (this.x in |player.x, player.x+3| && this.y in |player.y, player.y+3|) {
player.chat = "The NPC touched me!";
}
}
}