Question How do I add or remove weapons from the mystery box?

DemonHax

Known Member
Messages
50
Reaction score
6
Points
108
How do I add or remove weapons from the mystery box?
Here's what i've tried:

noWeaponsInBox(){
foreach(weapon in level.zombie_weapons)
weapon.is_in_box = 0;
}

allWeaponsInBox(){
foreach( weapon in level.zombie_weapons)
weapon.is_in_box = 1;
}

addWeaponToBox(weapon){
weapon.is_in_box = 1;
}
This does not seem to work however, and it seems that "noWeaponsInBox()" just adds all weapons to the box. Any suggestions?
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,744
Reaction score
2,824
Points
1,053
How do I add or remove weapons from the mystery box?
Here's what i've tried:


This does not seem to work however, and it seems that "noWeaponsInBox()" just adds all weapons to the box. Any suggestions?
This is interesting I'm going to take a look into this :wink: Could be the reference. Are you sure that you modify items in level.zombie_weapons when you foreach them and access them with weapon.FIELD?
 

DemonHax

Known Member
Messages
50
Reaction score
6
Points
108
What does `weapon.FIELD` do, and whats the usage?
This is interesting I'm going to take a look into this :wink: Could be the reference. Are you sure that you modify items in level.zombie_weapons when you foreach them and access them with weapon.FIELD?
 
Top