Here's the image statescript:
stateName[0] = "Activate";
stateTimeoutValue[0] = 0.15;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = weaponSwitchSound;
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "LoadCheckA";
stateAllowImageChange[1] = true;
stateSequence[1] = "Ready";
stateName[2] = "LoadCheckA";
stateScript[2] = "onLoadCheck";
stateTimeoutValue[2] = 0.01;
stateTransitionOnTimeout[2] = "LoadCheckB";
stateName[3] = "LoadCheckB";
stateTransitionOnAmmo[3] = "CheckForAmmo";
stateTransitionOnNoAmmo[3] = "Reload";
stateName[4] = "Reload";
stateTimeoutValue[4] = 4;
stateSound[4] = DrenDranReloadSound;
stateSequence[4] = "Reload";
stateScript[4] = "onReload";
stateTransitionOnTimeout[4] = "WaitForTriggerUp";
stateName[8] = "CheckForAmmo";
stateScript[8] = "onAmmoCheck";
stateTimeoutValue[8] = 0.01;
stateTransitionOnTimeout[8] = "CheckForAmmoB";
stateName[9] = "CheckForAmmoB";
stateTransitionOnAmmo[9] = "Fire";
stateTransitionOnNoAmmo[9] = "DryFire";
stateName[5] = "Fire";
stateTimeoutValue[5] = 0.25;
stateTransitionOnTimeout[5] ="WaitForTriggerUp";
stateFire[5] = true;
stateAllowImageChange[5] = false;
stateSequence[5] = "Fire";
stateScript[5] = "onFire";
stateWaitForTimeout[5] = true;
stateEjectShell[5] = true;
stateSound[5] = DrenDranSlowGunshotSound;
stateName[10] = "DryFire";
stateTimeoutValue[10] = 0.25;
stateTransitionOnTimeout[10] ="WaitForTriggerUp";
stateFire[10] = true;
stateAllowImageChange[10] = false;
stateSequence[10] = "Fire";
stateScript[10] = "onDryFire";
stateWaitForTimeout[10] = true;
stateEjectShell[10] = false;
stateSound[10] = DrenDranDryFireSound;
stateName[6] = "WaitForTriggerUp";
stateTransitionOnTriggerUp[6] = "WaitABitMore";
stateName[7] = "WaitABitMore";
stateWaitForTimeout[7] = true;
stateTransitionOnTimeout[7] = "Ready";
stateTimeoutValue[7] = 0.2;
(Yes, there's supposed to be two ammo checks, though this code needs a bit of cleaning and rearrangement before release)
If I do %player.setImageTrigger(0,true); it'll shoot the gun perfectly fine if it has ammo.
But if it doesn't, it'll technically do the dry fire and its script, but the animation won't play. Same with reloading.