ok i looked through the gunplus code and i modified that but now it's not working since when the ammo gets to 1 the sound doesn't play.
function barrettImage::onFire(%this,%obj,%slot)
{
if(%obj.getDamagePercent() < 1.0)
{
%obj.playThread(2, standJump);
}
if(%obj.barrettammo $= "")
%obj.barrettammo = 5;
bottomPrint(%obj.client, "<just:right><font:impact:25>\c3Ammo\c6: " @ %obj.barrettammo @ " / 5", 2);
if(%obj.barrettammo == 0)
{
%obj.unmountImage(%slot);
%obj.mountImage(barrettReloadImage, %slot);
%obj.barrettammo = 5;
}
Parent::onFire(%this,%obj,%slot);
%obj.barrettammo--;
}
function BarrettReloadImage::onComplete(%this,%obj,%slot)
{
%obj.schedule(1200, unmountImage, %slot);
%obj.schedule(1200, mountImage, BarrettImage, %slot, 1);
}
function BarrettImage::onMount(%this,%obj,%slot, %reloaded)
{
Parent::onMount(%this,%obj,%slot);
%obj.setMaxForwardSpeed(2);
%obj.setMaxSideSpeed(1);
%obj.setMaxBackwardSpeed(1);
%obj.hideNode("RHand");
%obj.hideNode("RHook");
%obj.hideNode("LHand");
%obj.hideNode("LHook");
if(%reloaded)
{
%obj.barrettammo = 5;
return;
}
}
function BarrettImage::onUnMount(%this,%obj,%slot)
{
Parent::onMount(%this,%obj,%slot);
%obj.unHideNode("ALL");
%obj.setMaxForwardSpeed(7);
%obj.setMaxSideSpeed(6);
%obj.setMaxBackwardSpeed(4);
if(isObject(%obj.client))
{
%obj.client.applyBodyParts();
%obj.client.applyBodyColors();
}
else
applyDefaultCharacterPrefs(%obj);
}