Answered his script applies to all doors, how do I make it only apply to doors you can buy to open

Aurora51x

#C?
Donator
Messages
138
Reaction score
62
Points
878
Code:
DoorDebrisvalues(value)
{
foreach( door in getentarray( "zombie_door", "targetname" ) )
{
door.zombie_cost = value;
door thread maps/mp/zombies/_zm_utility::set_hint_string( door, "default_buy_door", value );
}
foreach( debris in getentarray( "zombie_debris", "targetname" ) )
{
debris.zombie_cost = value;
debris thread maps/mp/zombies/_zm_utility::set_hint_string( debris, "default_buy_debris", value );
}
}

how can I make every door change the cost even the powered doors that need turbine :wink:
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,322
Reaction score
752
Points
973
Just thread this on your DoorDebrisvalues function;
Code:
setTurbineDoorCost( val )
{
    ary = getentarray("zombie_door", "targetname");
    trig = spawn("trigger_radius", (-7163,5246,-55), 1, 20, 10);
    while(1)
    {
        trig waittill("trigger", user);
        if(user useButtonPressed())
        {
            user maps/mp/zombies/_zm_score::minus_to_player_score( val, 1 );
            ary[14] notify("local_power_on");
            ary[15] notify("local_power_on");
            break;
        }
    }
}
 
Top