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