Alright, i got it to work, kinda
package BdayPartyDeath
{
function projectileData::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(matchBodyArea(getHitbox( %obj, %col, %pos ), $headTest ))
{
if(%col.getType() & $TypeMasks::PlayerObjectType)
{
if(%col.getDamagePercent() >= 0.8)
{
%proj = new Projectile()
{
scale = %obj.getScale();
dataBlock = bdayDeathProjectile;
initialPosition = %obj.getPosition();
sourceObject = %obj;
sourceSlot = 0;
client = %obj.client;
};
MissionCleanup.add(%proj);
serverPlay3D(BdayDeathSound,%obj.getTransform());
}
}
}
parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
};
activatePackage(BdayPartyDeath);
There's something about the 'if(striPos($headTest, %result) > -1)' it doesn't like, but it does work as intended, sort of
It's just that the hitbox for the headSkin is like, really glitchy, sometimes the face decal, and hardly even that, the default decal, where the eyes and mouth are, seem to be the only spot that causes the script to function, for some reason, randomly, the whole head is not counted, rather, a small portion of the front just...
So uh... what about that?
Also, getDamagePercent isn't very good, only as a placeholder, mostly because of the different amounts of damage that weapons do, so in most cases, the weapons won't bring a player to the specified amount of damage to activate the script
So if i raise the sensitivity of getDamagePercent, stronger weapons may skip the range in which the script activates while weaker weapons will activate the script before killing the victim, so that's pretty problematic