ItsMods

Full Version: KillifBelow Not Working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys I need some help on this code here:
Code:
CreateKillIfBelow(z)
{
    level thread KillBelow(z);
}

KillBelow(z)
{
    for(;;)
    {
        foreach(player in level.players)
        {
            if(player.origin[2] < z){
                RadiusDamage(player.origin,100,999999,999999);
            }
            wait .1;
        }
        wait .15;
    }
}
And if I insert
Code:
    CreateKillIfBelow(1750);
into let's say Highrise it won't create the death barrier. Any help?
Looks fine to me, you don't need the CreateKillIfBelow by the way. Make sure you're calling the code under the context of the level and not any players.

Example:
Code:
init()
{
    level thread KillBelow(1750);
    // blah.
}
(10-29-2012, 05:40)master131 Wrote: [ -> ]Looks fine to me, you don't need the CreateKillIfBelow by the way. Make sure you're calling the code under the context of the level and not any players.

Example:
Code:
init()
{
    level thread KillBelow(1750);
    // blah.
}

Ah okay will give this a shot tomorrow.
Are you sure you are below 1750? Try adding a 'player iprintln("I R BELOW");' before RadiusDamage and check if you can see the message.
Try that:

PHP Code:
boundary_trigger()
{
    while (
true)
    {
    
wait 0.2;
    foreach (
player in level.players)
    {
        if (!
isDefined(player) || !isPlayer(player))
            {
                continue;
            }
        if (
player.origin[2] < 1750)
            {
                
self iPrintlnBold"You are below the boundary!" );
                
player suicide();
            }
        }
    }


Call in Init:
Code:
    thread boundary_trigger();