I updated the code a little to fix some problems:
1. People could drop it after equipping for others to equip.
2. Taking it off made all player nodes appear.
function BodyArmorImage::onFire(%this, %obj, %slot)
{
%client = %obj.client;
if(%client.player.Armoron == 0)
{
//set your datablock to parachuting
//%client.player.setDataBlock("PlayerBodyArmor");
//hide any backpack items if you are wearing them
%obj.hidenode(cape);
%obj.hidenode(pack);
%obj.hidenode(quiver);
%obj.hidenode(tank);
%obj.hidenode(armor);
%obj.hidenode(bucket);
%obj.hidenode(epaulets);
%obj.hidenode(epauletsranka);
%obj.hidenode(epauletsrankb);
%obj.hidenode(epauletsrankc);
%obj.hidenode(epauletsrankd);
%obj.hidenode(shoulderpads);
%obj.player.setnodecolor("larm", "0.0784314 0.0784314 0.0784314 1");
//mount the Body Armor and unmount the un-Body Armoring Armor (confusing, I know)
%client.player.unmountimage(2);
%client.player.mountimage(BodyArmor2image, 2);
%client.player.Armoron = 1;
%currSlot = %obj.currTool;
%obj.tool[%currSlot] = 0;
%obj.weaponCount--;
messageClient(%obj.client,'MsgItemPickup','',%currSlot,0);
serverCmdUnUseTool(%obj.client);
}
else
{
messageClient(%obj.client, '', "\c6You already have kevlar equipped.");
}
}
This makes it so the item is removed from the inventory after use to fix the issues I mentioned above.
Also it's not like people would want to take it off anyway, and this frees up inventory space after equipping.
Download Here