yes, well keep the i==17 in because thats the correct format. At least thats one problem solved. Also, you have:
if (this.key5=true) it should be if (this.key5==true)
like Falcor said, = is an assignment, == means equal to
eg
this.var = 5; // Makes this.var equal to 5
Also, heres an example of a very simple timeout loop that is stopped:
NPC Code:
//#CLIENTSIDE
if (playerenters){
this.time = 100;
this.on = 1;
timeout = .05;
}
if (timeout && this.on == 1){
this.time --;
if (this.time<=0){
this.on = 0;
}
timeout = .05;
}
I suggest using :
if (timeout && i == 17) { //thingys; }
-Ning