Author Topic: Healing  (Read 563 times)

i am trying to make something a bit like the TF2 medigun, but everytime i shoot it at a player their blockland all frezzes up, whats wrong with my code, and while i have you hear, how would i make it go up by about 2 health every time the projectile hits you, rather than straght to full health?

Code: [Select]
function MediProjectile::onCollision(%this,%obj,%col,%pos,%fade)
{
if(%col.getClassName() $= "Player" && %col.getDamagePercent() < 100)
{
%col.setDamageLevel(0);
%col.emote(medigunhealImage);
%col.delete();
}
return;
Parent::onCollision(%this,%obj,%col,%pos,%fade);
}
« Last Edit: October 10, 2008, 03:32:51 AM by Racer »

Quote
   function MediProjectile::onCollision(%this,%obj,%col,%pos,%fade)
   {
      if(%col.getClassName() $= "Player")
      {
         if(%col.getDamageLevel() >= 2)
            %col.setDamageLevel(%col.getDamageLevel()-2);
         else
            %col.setDamageLevel(0);
         %col.emote(medigunhealImage);
      }
      return;
      Parent::onCollision(%this,%obj,%col,%pos,%fade);
   }

I removed the %col.delete() part - wouldn't that delete the player object?

You also might want to make a minigame check or use ProjectileData::Damage etc.

You should have talked to destiny about this, we worked on something similar, exept it was a /command

thanks space guy, it works just how i want it.