Why not just package GameConnection::onDeath and then check how many players there are left in the minigame, and if one, delete the WaterPlane and WaterZone objects (deleting this removes lava, you will want to create it again later)
package lavakill
{
function GameConnection::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc)
{
parent::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc);
if(isObject(%client.minigame))
{
%peopleAlive = 0;
for(%i=0;%i<%client.minigame.numMembers;%i++)
{
%miniPlayer = %client.minigame.member[%i];
if(isObject(%miniPlayer.player))
{
%peopleAlive++;
}
}
echo("There are " @ %peopleAlive @ " people alive.");
if(%peopleAlive == 1)
{
if(isObject(WaterPlane))
{
WaterPlane.delete();
WaterZone.delete();
}
}
}
}
};
activatePackage(lavaKill);
I tested it and apparently onDeath will detect deaths by lava and it seems to work.
To add the lava back later simply use:
new fxPlane(WaterPlane) {
position = "0 0 4.5";
rotation = "1 0 0 0";
scale = "1 1 1";
topTexture = "Add-Ons/Water_Lava/lava.png";
bottomTexture = "Add-Ons/Water_Lava/lava.png";
loopsPerUnit = "0.15";
scrollSpeed = "0.000000 0.000000";
color = "255 255 255 255";
rayCastColor = "128 128 128 255";
blend = "0";
additiveBlend = "0";
colorMultiply = "1";
isSolid = "0";
useShader = "1";
};
new PhysicalZone(WaterZone) {
position = "-500000 500000 -95";
rotation = "1 0 0 0";
scale = "1e+006 1e+006 100";
velocityMod = "1";
gravityMod = "1";
extraDrag = "0";
isWater = "1";
waterViscosity = "40";
waterDensity = "1";
waterColor = "0.941177 0.380392 0.066667 0.745098";
waterType = "8";
appliedForce = "0 0 0";
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
};
Then add the code to properly set the lava height.