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

jcal147

Veteran
Messages
63
Reaction score
12
Points
568
Code:
Doorvalues(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 );
    }
}
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,745
Reaction score
2,831
Points
1,053
Code:
Doorvalues(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 );
    }
}
You could use a if which checks the hint before, because all zombie "buyable" doors hints begin with:
Code:
default_buy_debris
 

jcal147

Veteran
Messages
63
Reaction score
12
Points
568
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 );
}
}
 

jcal147

Veteran
Messages
63
Reaction score
12
Points
568
problem is that unbuyable doors such as doors opened with turbine say buy door for "value"
how do I fix this?
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,745
Reaction score
2,831
Points
1,053
problem is that unbuyable doors such as doors opened with turbine say buy door for "value"
how do I fix this?
Yeah
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 );
}
}
This is not correct you can't do it like this. :smile: I will look into it later.
 
Top