View Single Post
  #6  
Old 06-17-2013, 01:50 PM
Julien Julien is offline
Registered User
Join Date: Jun 2013
Posts: 8
Julien is on a distinguished road
Quote:
Originally Posted by Chompy View Post
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.speed 1;
}

function 
onTimeout() {
  
player.+= (keydown(3)-keydown(1))*this.speed;
  
player.+= (keydown(2)-keydown(0))*this.speed;
  
setTimer(0.05*this.on);
}

function 
onKeyPressed(codekey) {
  
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.
Reply With Quote