How i Make a Script of weapon that kills a bot?

Author Topic: How i Make a Script of weapon that kills a bot?  (Read 1349 times)

Guys, he means a script that insta-kills a bot when fired regardless of the gun.
Set the projectile damage to 100


The weapon instakills only bots.
test this for me

Code: [Select]
package InstaKillsOnlyBots
{
   function YourWeaponProjectileData::damage(%this,%obj,%col,%fade,%pos,%normal)
   {
   if(%this.directDamage <= 0)
      return;

   %damageType = $DamageType::Direct;
   if(%this.DirectDamageType)
      %damageType = %this.DirectDamageType;

   %scale = getWord(%obj.getScale(), 2);
   
   if(%col.getClassName() $= "AIPlayer")
       %directDamage = %col.getDatablock().maxHealth; //is this the armor datablock attribute for the max health?
   else
       %directDamage = mClampF(%this.directDamage, -100, 100) * %scale;
   if(%col.getType() & $TypeMasks::PlayerObjectType)
      %col.damage(%obj, %pos, %directDamage, %damageType);
   else
      %col.damage(%obj, %pos, %directDamage, %damageType);
   }
};
activatepackage(InstaKillsOnlyBots);