it fires, and uses the firing gani when i use the fire button, but then i go back to the normal idle gani, and my way of turning the weapon on and off also isn't working.
PHP Code:
//#CLIENTSIDE
function onWeaponFired()
{
if(temp.equip == 0)
{
shoot(player.x + 1.5 + vecx(player.dir), player.y + 2 + vecy(player.dir), player.z-1, (playerdir + 1) * pi / 2, NULL, NULL, "arrow", NULL);
setani("era_deagle-fire", NULL);
client.replaceani = {"idle", "era_deagle-idle"};
client.replaceani = {"walk", "era_deagle-walk"};
freezeplayer(0.1);
}
else
{
player.chat = "hi";
}
}
function onActionProjectile()
{
player.hearts -= 2;
}
function onKeyPressed(code,key)
{
if(key == "f" && temp.equip == 1)
{
client.replaceani = {"era_deagle-reload"};
client.replaceani = {"idle", "era_deagle-idle"};
client.replaceani = {"walk", "era_deagle-walk"};
temp.equip = 0;
}
else if(key == "f" && temp.equip == 0)
{
setani("idle");
temp.equip = 1;
}
}