Question Can Someone help me with some box scripts? script keeps crashing

Demon xModRx

Insane-Known Member
Messages
63
Reaction score
5
Points
358
Can Someone help me with some box scripts? The scripts keep crashing me. im pretty sure that its the AllWeaponsInBox() script thats crashing me, but i cant sort it out. after mulipile attempts at creating them, i decided to take these from iconic. here are the scripts;

AllWeaponsInBox()
AllWeaponsInBox()
{
level.demon_modded_box = 1;
if( isDefined( level.custom_magic_box_selection_logic ) )
level.custom_magic_box_selection_logic = undefined;
if( isDefined(level.special_weapon_magicbox_check) )
level.special_weapon_magicbox_check = undefined;
if( isDefined(level.content_weapon) )
level.content_weapon = undefined;
foreach( weapon in level.zombie_weapons)
weapon.is_in_box = 1;
level.limited_weapons = [];
level.demon_box_weapons = [];
level.demon_box_weapons = array_copy( level.zombie_weapons );
level.customrandomweaponweights = array_randomize(level.zombie_weapons);
}

NoWeaponsInBox()
NoWeaponsInBox()
{
if(!isDefined(level.demon_modded_box))
AllWeaponsInBox();
level.limited_weapons = [];
level.demon_box_weapons = [];
self b("No Weapons In Box");
}

AddWeaponToBox()
addweapontobox(value)
{
if(!isDefined(level.demon_modded_box))
{
AllWeaponsInBox();
}
level.zombie_weapons[ value ].is_in_box = 1;
level.limited_weapons[ value ] = undefined;
level.demon_box_weapons = add_to_array( level.demon_box_weapons, value, 0);
self b(value+" ^2Added");
}
 
Top