Author Topic: How do you make hand disappear?  (Read 1147 times)

I made a addon where you shoot bullets outta your hand but I don't know how to make your right hand disappear

function YourGunImage::onMount(%this,%obj,%slot)
{
      parent::onMount(%this,%obj,%slot);
      %obj.hideNode(rHand);
      %obj.hideNode(rHook);
}

function YourGunImage::onUnMount(%this,%obj,%slot)
{
      parent::onMount(%this,%obj,%slot);
      %obj.unhideNode(rHand);
      %obj.unhideNode(rHook);
}
« Last Edit: December 10, 2016, 03:03:30 PM by Perry »

Code: [Select]
function YourGunImage::onMount(%this,%obj,%slot)
{
      parent::onMount(%this,%obj,%slot);
      %obj.prevHand = %obj.isNodeVisible("rHand");
      %obj.hideNode(rHand);
      %obj.hideNode(rHook);
}

function YourGunImage::onUnMount(%this,%obj,%slot)
{
      parent::onMount(%this,%obj,%slot);
      %obj.unhideNode((%obj.prevHand ? "rHand" : "rHook"));
}

actually you should do something like this unless you want the player having both the hand and hook visible when unmounting the image

or just, %client.applyBodyParts() or whatever it was called. been too long since I last coded lol

or just, %client.applyBodyParts() or whatever it was called. been too long since I last coded lol
that wouldnt work for if bots used the weapon

function YourGunImage::onMount(%this,%obj,%slot)
{
      parent::onMount(%this,%obj,%slot);
      %obj.hideNode(rHand);
      %obj.hideNode(rHook);
}

function YourGunImage::onUnMount(%this,%obj,%slot)
{
      parent::onMount(%this,%obj,%slot);
      %obj.unhideNode(rHand);
      %obj.unhideNode(rHook);
}

Where would I put this code,I am new to making weapons

EDIT:Nevermind I got it!Thanks for the help!
« Last Edit: December 10, 2016, 06:39:48 PM by ComicSans »

Where would I put this code,I am new to making weapons
in the code of your gun.

also do what Swollow says its better