Author Topic: [RPG] - Not stunning the enemy  (Read 600 times)

There is no error code. What did I do wrong?

   function jumperProjectile::radiusDamage(%this, %obj, %col, %distanceFactor, %pos, %damageAmt)
   {
      %col = %col.sourceObject;
      if(!isObject(%col) || !isObject(%obj))
         return;
      if(((%col.getClassName() $= "Player" && %obj.getClassName() $= "Player") && (!%col.PvP && !%obj.PvP)) || (%col.getClassName() $= "AIPlayer" && %obj.getClassName() $= "AIPlayer"))
         return;
      if(%obj == %col)
         return;
      %obj.setRPG_Stun(1);
      %obj.RPG_Stun();
      parent::radiusDamage(%this, %obj, %col, %distanceFactor, %pos, %damageAmt);
   }

      %col = %col.sourceObject.player;
sourceObject in projectiles usually refer to the client.
This usually sets things right for me
make sure you restore %col to what it was prior to your modifying.
« Last Edit: October 28, 2013, 10:45:07 PM by Alphadin »

sourceObject in projectiles usually refer to the client.
This usually sets things right for me
make sure you restore %col to what it was prior to your modifying.
No, no, no.
      %col = %col.sourceObject;
Remove this line. %col is what the projectile hit, and you just made it whateverTheProjectileHit.sourceObject, which is generally an undefined variable (AKA blank).
« Last Edit: October 29, 2013, 07:58:51 AM by jes00 »

No, no, no.Remove this line. %col is what the projectile hit, and you just made it whateverTheProjectileHit.sourceObject, which is generally an undefined variable (AKA blank).
right, I was thinking of %obj (which the above usually applies to)