Quote:
Originally Posted by Chompy
PHP Code:
//#CLIENTSIDE
function onCreated() {
this.speed = 1;
}
function onTimeout() {
player.x += (keydown(3)-keydown(1))*this.speed;
player.y += (keydown(2)-keydown(0))*this.speed;
setTimer(0.05*this.on);
}
function onKeyPressed(code, key) {
this.on = abs(this.on-(key=="b"));
setTimer(0.05*this.on);
}
function onPlayerChats() {
if (player.chat.starts("/speed ") && this.on) {
this.speed = int(player.chat.substring(7));
}
}
Tested this staff boots script, just to see how it works, and it gave this error in the onPlayerChats() event, right under the if statement: NPC Code:
Unexpected symbol 'if'
But apart from that, looking good!
|
There was a problem with the '&' and '&&' operators.
It's fixed now.
Your script is reporting more meaningful errors.
Please note that built-in global functions are only partially supported:
"keydown" and "setTimer" are still being reported as not existing functions.