Quote:
Originally Posted by Tyhm
Thank you captain smarmypants, that's the same as an answer. I suppose then that I could say with(npcs) or for (npc:npcs) and it's a protected variable which always contains an array of all NPCs on the server in perpetuity? Or should I be doing an old fashioned for(temp.i=0;temp.i<npcscount;temp.i++) if(npcs[i].x... ?
|
'npcs' is an array of all the NPCs in your current level. Similar to the 'players' array.
PHP Code:
for (temp.npc : npcs) {
echo("I found an NPC at (" @ npc.x @ "," SPC npc.y @ ") with an image of" SPC npc.image @ "!");
npc.trigger("Poke", player.account);
npc.var = "foo";
}