View Single Post
  #16  
Old 07-26-2004, 08:50 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally Posted by falco10291029
NPC Code:


for (this.i=int(random(0,npcscount));found=0;this.i++) {
if (npcs[this.i].hearts>0) found=1;
if (this.i>npcscount) this.i-=npcscount;

}

This makes no sense, try something a little more to the point, such as;
NPC Code:

for (this.i=0;this.i<npcscount;this.i++) {
if (npcs[this.i].hearts>0) {
this.found = 1;
break;
}
}



I'd say more, but you're better off getting your script to work before worrying about refining your scripts. "learn to walk before you run" As we say
consarnit extra spaces in the code brackets, BAH I say! Edit: what's up with all this non-sensical spam? this forum used to be nice
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote