Author Topic: How to make a thrown weapon, leave your inv....  (Read 715 times)

...tory, what is the line of code, I am making some grenades tonight, beta should be out this week, in mod disccusion.

This is in the HE Grenade code.

Code: [Select]
function hegrenadeImage::onMount(%this, %obj, %slot)
{
%obj.grenadeslotsave = %obj.currTool;
}

Code: [Select]
function hegrenadeImage::onFire(%this, %obj, %slot)
{
for(%i=0;%i<5;%i++)
{
%toolDB = %obj.tool[%i];
if(%toolDB $= %this.item.getID() && %i == %obj.grenadeslotsave)
{
%obj.tool[%i] = 0;
%obj.weaponCount--;
messageClient(%obj.client,'MsgItemPickup','',%i,0);
serverCmdUnUseTool(%obj.client);
break;
}
}
}