function luckyGunProjectile::onCollision(%db,%proj,%hit,%vec,%pos)
{
if(%hit.getType() & $TypeMasks::PlayerObjectType)
{
if(getRandom(0,9) == 0)
{
%hit.damage(%proj.client,%pos,1,%db.damageType);
}
else
{
%hit.damage(%proj.client,%pos,100*1000,%db.damageType);
}
return;
}
parent::onCollision(%db,%proj,%hit,%vec,%pos);
}
you would want to do something like this for the projectile, the first if statement checks to see if the thing you hit is a player object type, then it chooses a random number between 0-9 meaning landing on a single number is a 10% chance, if the random gets a 0, it applies 1 damage to the hit object, otherwise it applies 100,000 damage to the hit object, the return statement prevents the normal collision code from occuring
if the object is not a player object type the normal collision code will occur