Quote:
Originally Posted by Fysez
I've got the whole Gani part working. Problem is,
Once I equip and use the item,
It doesn't allow me to un-equip?
PHP Code:
//#CLIENTSIDE function onWeaponFired() { if (this.on = false) { this.on = true; setani("Gani", null); replaceani("idle", "Gani"); replaceani("walk", "Gani2"); this.on = true; }else if (!this.on){ setani("idle", null); replaceani("idle", "idle"); } }
|
A few things.
if (this.on = false)
should be
if(this.on == false)
= sets values, == checks for equivalency.
Even if that was fixed it still wouldn't work, !this.on is the same thing as this.on == false, so you are checking if the weapon is off in both your if statements.
Also your aren't setting this.on back to false at any point, so once you unequip it once its going think its still on and you won't be able to reequip it. And you aren't resetting your walk gani to walk when you turn it off.