Say I wanted the gun to have a one time use, so that when you fire the gun is no longer in your inventory. Wouldn't I use something like this? I found this in another script so I tried it out.
function gunImage::onFire(%this,%obj,%slot)
{
if(%obj.getDamagePercent() < 1.0)
%obj.playThread(2, shiftAway);
Parent::onFire(%this,%obj,%slot);
%currSlot = %obj.lastHESlot;
%obj.tool[%currSlot] = 0;
%obj.weaponCount--;
messageClient(%obj.client,'MsgItemPickup','',%currSlot,0);
serverCmdUnUseTool(%obj.client);
}
The only problem is that when I fire, it dissapeares from my hand but remains in my inventory.
Also, how do you check if a player is in a minigame?
Also again, why won't this work?
function GunProjectile::damage(%this,%obj,%col,%fade,%pos,%normal)
{
%client = %obj.client;
if(%client.minigame)
{
%client.kill();
}
}