View difference between Paste ID: PiJ96deN and YCbWYppk
SHOW: | | - or go back to the newest paste.
1
package BdayPartyDeath
2
{
3
function projectileData::onCollision(%this,%obj,%col,%fade,%pos,%normal)
4
{
5
   %result = parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
6
   if(matchBodyArea(getHitbox( %obj, %col, %pos ), $headTest ))
7
   {
8
      if(%col.getType() & $TypeMasks::PlayerObjectType)
9
      {
10
         announce(%col.getState());
11
         if(%col.getState() $= "Dead")
12
         {
13
            %proj = new Projectile()
14
            {
15
               scale = %obj.getScale();
16
               dataBlock = bdayDeathProjectile;
17
               initialPosition = %obj.getPosition();
18
               sourceObject = %obj;
19
               sourceSlot = 0;
20
               client = %obj.client;
21
            };
22
            MissionCleanup.add(%proj);
23
            serverPlay3D(BdayDeathSound,%obj.getTransform());
24
         }
25
      }
26
   }
27
   return %result;
28
}
29
};
30
activatePackage(BdayPartyDeath);