Author Topic: Reset Mini-Game on death  (Read 550 times)

I'm making a campaign gamemode, and I want to know if I can make the mini-game reset on the player's death.

Could someone get me an addon/way to do it?

Do you want it to reset when they click to respawn or as soon as they die?

Do you want it to reset when they click to respawn or as soon as they die?
I guess when they click to respawn.

You could always use Slayer and give them one life.

Code: [Select]
package ResetMiniOnDeath
{
function GameConnection::spawnPlayer(%client)
{
Parent::spawnPlayer(%client);
if(%client.hasSpawnedOnce && isObject(%client.minigame))
%client.minigame.reset(0);
}
};
activatepackage(ResetMiniOnDeath);

You should only parent if the minigame is not going to reset. The minigame reset takes care of spawning the players iirc.

Edit: Oh I see why you did it anyways. If there is no better solution, I guess it's not a big deal.
« Last Edit: April 27, 2016, 09:23:46 AM by Dannu »

Default minigames have this functionality. Set respawn time to -1.

Default minigames have this functionality. Set respawn time to -1.
Code: [Select]
package ResetMiniOnDeath
{
function GameConnection::spawnPlayer(%client)
{
Parent::spawnPlayer(%client);
if(%client.hasSpawnedOnce && isObject(%client.minigame))
%client.minigame.reset(0);
}
};
activatepackage(ResetMiniOnDeath);
Okay I'll (try) use both of these. Thanks.

Locking thread now.