I don't get it. You want a function, but there is already a gameConnection::onDeath function.
I know this, but I wasn't sure about how to write up the whole function with %killer and all that.
there's also the matter of knowing what to call the event on
you're gonna have a bad time if you loop through every brick in the simulation every time someone dies
I would like it if the event was called on the brick, yes. I could use only one brick for the event
onPlayerDeath > Client > BottomPrint > You have died
Thats a simple example. I mainly need this event so I can do this:
onPlayerDeath > Client > VCE_ifVar > Wanted = 1;
onVarFalse > KillerClient > BottomPrint > You have freekilled!
onVarFalse > namedBrick > doPlayerTeleport > Jail > Relative?
-coolsnip
Thanks! I do not use Slayer, I use a modified version of Spaceguys TDM. I like Slayer and all, I just find the original TDM to be more simple for the things I need. I sometimes switch to Slayer when I need something specific (such as a dedicated server minigame, or for spawning next round upon joining)
If I were to make this without being depandant upon other mods, would it be something like this?
registerInputEvent(fxDtsBrick,"onPlayerDeath","Self fxDtsBrick\tPlayer Player\tVictimPlayer Player\tVictimClient GameConnection\tClient GameConnection\tMinigame Minigame");
function GameConnection::onDeath(%this, %client, %obj, %killer, %type, %pos)
{
parent::onDeath(%this, %client, %obj, %killer, %type, %pos);
%mini = getMinigameFromObject(%this);
%pos = %this.getTransform();
$InputTarget_["Client"] = %client;
$InputTarget_["Player"] = %client.player;
$InputTarget_["KillerClient"] = %killer.client;
$InputTarget_["KillerPlayer"] = %killer.player;
$InputTarget_["Minigame"] = %mini;
%mini.processInputEvent("onPlayerDeath", %client, %mini);
}
Also, I haven't tested, but will that work both in and out of minigames?