Author Topic: Dismemberment and head-shots?  (Read 707 times)

Alright so I am in the process of making a gun, but how would I go about making the bullet dismember the victim's limbs, just like how the chainsaw does? (I can't seem to find the chainsaw so I can't examine how it does this.) I also want to increase damage done from head-shots, and possibly body shots as well. Any help would be greatly appreciated.

The limbs don't actually fall off, they just disappear with what I think is called a hideNode.

Code: [Select]
package headshot{
 function ProjectileData::damage(%this, %obj, %col, %fade, %pos, %normal){
  %this2=%this;
  if(%col.getClassName()$="Player"){
   if(getword(%pos,2)>getword(%col.getWorldBoxCenter(),2)-3.3){
    %name = %this.GetName();
    if(%name$="sniperrifleLVProjectile"){
     %this2=sniperrifleLVheadshotprojectile;
     showheadshot(%obj,%col);
     %obj.emote(WinStarProjectile);
    }
   }
  }
   return Parent::damage(%this2, %obj, %col, %fade, %pos, %normal);
 }
};
ActivatePackage(headshot);

function showheadshot(%obj,%col){
 if(!$TG_headshots){
  bottomprint(%obj.client,"<bitmap:add-ons/Weapon_SVD/star> \c3Headshot "@%col.client.name,3,4);
  bottomprint(%col.client,"<bitmap:add-ons/Weapon_SVD/star> \c7"@%obj.client.name@" Headshot",3,4);
 }
}
BOOM! Head Shot!

Code: [Select]
snipBOOM! Head Shot!
That's inaccurate, it doesn't account for bots, scale, or crouching. Additionally it also doesn't take the head off.

I'd recommend looking at the SG550, it uses a script based on player painting to detect whether or not you hit the head.