View Single Post
  #9  
Old 03-14-2009, 09:15 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Tyhm View Post
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."," SPC npc.") with an image of" SPC npc.image "!");
  
npc.trigger("Poke"player.account);
  
npc.var = "foo";

__________________
Reply With Quote