Quote:
Originally posted by Projectshifter
::fully agrees::
We're assuming this is a weapon right?
---Shifter
|
No weapon, just a normal NPC in a level.
NPC Code:
if (timeout) {
if (this.dir=0) y-=0.3;
if (this.dir=2) y+=0.3;
if (this.dir=1) x-=0.3;
if (this.dir=3) x+=0.3;
message #v(this.dir);
timeout=0.5;
}
if (actionmove) {
this.dir=strtofloat(#p(0));
timeout=1;
}
//#CLIENTSIDE
if (timeout) {
if (keydown(1)&&!this.dir=1) {triggeraction x,y,move,1;this.dir=1;}
if (keydown(3)&&!this.dir=3) {triggeraction x,y,move,3;this.dir=3;}
if (keydown(0)&&!this.dir=0) {triggeraction x,y,move,0;this.dir=0;}
if (keydown(2)&&!this.dir=2) {triggeraction x,y,move,2;this.dir=2;}
timeout=0.05;
}
This is NOT the whole script. Also, the player is attached to it.
EDIT: It wont triggeraction AFTER the first timeout=1; serverside. I have no idea why.