Part of my current project involves doing something at the killer's location when he kills someone. I couldn't find a specific "onKill" function, so I took GameConnection::onDeath. Here is a small section of the script, which is inside a package in which other overwritten scripts work just fine:
function GameConnection::OnDeath(%this, %killerPlayer, %killer, %damageType, %damageLoc)
{
ServerPlay3D(killSound, %killerPlayer.getPosition());
Parent::OnDeath(%this, %killerPlayer, %killer, %damageType, %damageLoc);
}
I have tried every imaginable combination of using %this, %killerplayer, and %killer to try and play a sound at the killer when a player dies. But it either throws errors or plays it at the victim instead. I gave this problem to some of my more experienced friends and we tried all sorts of combinations and it still didn't work.
What's going wrong? Am I missing something obvious?