Thanks guys, I'll give it a shot.
Although chris, I'm not exactly familiar with GraalControl yet.
or Keyup and KeyDown even though, i have tried using them before. (keydown that is)
Quote:
Originally Posted by cbk1994
Better yet:
PHP Code:
function GraalControl.onKeyDown(code, key) {
if (key == "d" && player.weapon == this && ! this.d) {
this.onTimeOut();
this.d = true;
}
}
function onTimeOut() {
if (player.weapon != this) {
return;
}
// shoot stuff goes here
if (this.isAutomatic) {
this.setTimer(this.sleepTime);
}
}
function GraalControl.onKeyUp(code, key) {
if (key == "d" && player.weapon == this) {
this.setTimer(0);
this.d = false;
}
}
|