In the future I'd try using PHP and
http://www.fp4.ca/gs2beautifier/ before posting on the forums. Makes it a lot easier to read.
PHP Code:
// Weapons Script for PB (PLANET BASE)
// MADE BY: Take(Defaultaccount),Delta(),
//#CLIENTSIDE
function onEquip() {
this.equiped = true;
freezeplayer(this.equip);
setani(this.equip2, null);
replaceani("walk", this.walk);
replaceani("idle", this.idle);
}
function onCreated() {
this.spread = 0.00; // Controls the spread of weapon
this.speed = 0.2; // Controls the fire rate of weapon
this.reload = 0.1; // Controls the reload of the weapon
this.freeze = 0.05; // Controls the freeze of the weapon
this.equip = 0.5; // Controls the equip time of the weapon
this.bspeed = 1; // Controls the speed of the bullet
this.bulletangle = -.5; // Controls the angle of the bullet
disableweapon(sword);
setani(this.idle, null);
this.walk = "pb_mp5navy-walk";
this.idle = "pb_mp5navy-idle";
this.ewalk = "pb_mp5navy-unequiped-walk";
this.eidle = "pb_mp5navy-unequiped-idle";
this.equip2 = "pb_mp5navy-equip";
this.unequip = "pb_mp5navy-unequip";
this.fire = "pb_mp5navy-fire";
this.reload2 = "pb_mp5navy-unequip";
}
function GraalControl.onKeyUp(code, key, scan) {
if (key == "a") {
freezeplayer(this.reload);
setani(this.reload2, null);
}
if (key == "f") {
setani(this.unequip, null);
replaceani("walk", this.ewalk);
replaceani("idle", this.eidle);
freezeplayer(this.equip);
this.equiped = false;
}
if (key == "s") {
this.equiped = false;
replaceani("walk", "walk");
replaceani("idle", "idle");
return;
}
if (key == "d") {
if (this.equiped = true) {
setani(this.fire, null);
freezeplayer(this.freeze);
this.angle = getangle(vecx(playerdir), vecy(playerdir));
setshootparams(player.account);
shoot(player.x + .3, player.y + .3, player.z, this.angle + random(this.bulletangle, abs(this.bulletangle)), 0, 0, "pb_bullet1", "pb_bullet1.png");
if (this.equiped = false) {
onEquip();
}
}
}
}
function onActionProjectile() {
player.hearts = -.5;
}
I am curious to know why you're using
PHP Code:
function GraalControl.onKeyUp(code, key, scan) {
//Key up..
}
Instead of
PHP Code:
function GraalControl.onKeyDown(code, key, scan) {
//Key Down..
}
Although I'm not sure what your issue is without testing it later.