This is a slightly more complex way to do that. It shows a lot more techniques of manupilating strings/variables. Either way works just fine.
NPC Code:
//#CLIENTSIDE
if (created) this.speed = 0.5;
if (weaponfired) {
this.inuse = ( this.inuse + 1 ) % 2;
tokenize Off On;
setplayerprop #c,Boots #t(this.inuse);
timeout = 0.05;
}
if (timeout && this.inuse == 1){
this.x = (keydown(3) - keydown(1));
this.y = (keydown(2) - keydown(0));
playerx += this.x * this.speed;
playery += this.y * this.speed;
timeout = 0.05;
}
if (playerchats){
if (strequals(#e(0,6,#c),/boots)){
tokenize #c;
setstring this.list,off,on;
if (strtofloat(#t(1)) > 0){
this.speed = strtofloat(#t(1));
} else if (lindexof(#t(1),this.list) > -1){
this.inuse = lindexof(#t(1),this.list);
timeout = 0.05;
}
}
}