.. you could have used testnpc too
something like:
NPC Code:
if (created||timeout){
if (testnpc(mousex,mousey)<=0){
with (npcs[testnpc(mousex,mousey)]){
message test;
}
}
timeout=.05;
}
or you could use == instead if you want it to relate to the npc with that index