Can anyone fix this so i hit 1 to turn on and 1 again to turn off? i naver could make scripts do that =/, Thanx:
if (created) {this.mode = 1;}
if (keypressed && strequals(#p(1),1) && this.mode = 1

{
setstring client.dir,#v(playerdir);
this.mode = 2;
}
if (this.mode = 2) {
timeout=.05;
if (keydown(0) || keydown(1) || keydown(2) || keydown(3) ) {
playerdir = strtofloat(#s(client.dir));
}
if (keypressed && strequals(#p(1),2) && this.mode = 2

{
setstring client.dir,4;
this.mode = 1;
timeout = 0.00;
}
}