Release (ZM) Editing The Mystery Box Price/Hiding It

CF4_99

Veteran
Messages
145
Reaction score
57
Points
888
Hello Everyone, today I have another release, and it is 2 things,
1. Changing The Price Of The Mystery Box To Whatever You Want.
2. Hiding/Taking Away The Mystery Box

I have been trying to find a way to change the price of the Mystery Box for a while and finally found it, I also stumbled across a code that hides the Mystery Box!
So Here It Is Enjoy! :grinning:

Make Sure To Use This #include
#include maps/mp/zombies/_zm_magicbox;
Hide/Take Away Mystery Box
Code:
SetBoxHidden()
{
    i = 0;
    while(i < level.chests.size)
    {
        level.chests[ i ] hide_chest();
        level.chests[ level.chest_index ].hidden = 1;
        i++;
    }
    self iPrintln("Mystery Box ^2Hidden");
}


Set Mystery Box Price
Code:
SetBoxCost()
{
    i = 0;
    while (i < level.chests.size)
    {
        level.chests[ i ].zombie_cost = 50;
        level.chests[ i ].old_cost = 50;
        i++;
    }
    self iPrintln("Mystery Box Cost Set To ^250");
}


Set Mystery Box Price To Custom(Easier/Faster Way)
Code:
SetBoxCostCustom(cost)
{
    i = 0;
    while (i < level.chests.size)
    {
        level.chests[ i ].zombie_cost = cost;
        level.chests[ i ].old_cost = cost;
        i++;
    }
    self iPrintln("Mystery Box Cost Set To ^2"+cost+"");
}

Example For The Custom Mystery Box Price
Code:
self add_option("MainMods", "Set Box Cost To 10", ::SetBoxCostCustom, 10);

Credits:
CabCon(Didn't Realize He Already Found The hide_chest/show_chest)​
 
Last edited:

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053
Hello Everyone, today I have another release, and it is 2 things,
1. Changing The Price Of The Mystery Box To Whatever You Want.
2. Hiding/Taking Away The Mystery Box

I have been trying to find a way to change the price of the Mystery Box for a while and finally found it, I also stumbled across a code that hides the Mystery Box!
So Here It Is Enjoy! :grinning:

Make Sure To Use This #include
#include maps/mp/zombies/_zm_magicbox;
Hide/Take Away Mystery Box
Code:
SetBoxHidden()
{
    i = 0;
    while(i < level.chests.size)
    {
        level.chests[ i ] hide_chest();
        level.chests[ level.chest_index ].hidden = 1;
        i++;
    }
    self iPrintln("Mystery Box ^2Hidden");
}


Set Mystery Box Price
Code:
SetBoxCost()
{
    i = 0;
    while (i < level.chests.size)
    {
        level.chests[ i ].zombie_cost = 50;
        level.chests[ i ].old_cost = 50;
        i++;
    }
    self iPrintln("Mystery Box Cost Set To ^250");
}


Set Mystery Box Price To Custom(Easier/Faster Way)
Code:
SetBoxCostCustom(cost)
{
    i = 0;
    while (i < level.chests.size)
    {
        level.chests[ i ].zombie_cost = cost;
        level.chests[ i ].old_cost = cost;
        i++;
    }
    self iPrintln("Mystery Box Cost Set To ^2"+cost+"");
}

Example For The Custom Mystery Box Price
Code:
self add_option("MainMods", "Set Box Cost To 10", ::SetBoxCostCustom, 10);
Good job! :grinning: Here is something similar for Black Ops 3:
Code:
#using scripts\zm\_zm_magicbox;

function func_boxcost(i){
    self S("Box Opening price set to ^2" +i);
     foreach(box in level.chests)
        box.zombie_cost = i;
}
function func_ShowBoxess() {
        self S("All Mystery Boxes ^2Spawned");
        foreach(box in level.chests)
            box thread zm_magicbox::show_chest();
}
function func_HideBoxess() {
    self S("All Mystery Boxes ^2Hidden");
    foreach(box in level.chests)
        box thread zm_magicbox::hide_chest(0);
}
function func_BoxesNeverMove() {
    self S("Unlimited Chest Rolls ^2Successful");
    level.chest_min_move_usage = 999;
}
 

CF4_99

Veteran
Messages
145
Reaction score
57
Points
888
Good job! :grinning: Here is something similar for Black Ops 3:
Code:
#using scripts\zm\_zm_magicbox;

function func_boxcost(i){
    self S("Box Opening price set to ^2" +i);
     foreach(box in level.chests)
        box.zombie_cost = i;
}
function func_ShowBoxess() {
        self S("All Mystery Boxes ^2Spawned");
        foreach(box in level.chests)
            box thread zm_magicbox::show_chest();
}
function func_HideBoxess() {
    self S("All Mystery Boxes ^2Hidden");
    foreach(box in level.chests)
        box thread zm_magicbox::hide_chest(0);
}
function func_BoxesNeverMove() {
    self S("Unlimited Chest Rolls ^2Successful");
    level.chest_min_move_usage = 999;
}
That is very similiar, I was about to edit the post and add the show box function, lol
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,327
Reaction score
763
Points
973
This is amazing and very useful, I been seeing new menus with dope mystery box scripts like full control, Any of y'all can give an example on how I can give the box a rule to set only one gun in it? I buy you dinner :grinning:
Code:
oneWeaponInBox( weap )
{
    foreach(weapon in level.zombie_weapons)
        weapon.is_in_box = 0;
    wait .5; // need to wait for the above to complete;
    level.zombie_weapons[ weap ].is_in_box = 1;
    self iprintln(weap + " is now the only weapon in the mystery box.");
}

how to use
Code:
self addOpt("only HAMR in mystery box", ::oneWeaponInBox, "hamr_zm");
 

_tcblue

New Member
Messages
3
Reaction score
0
Points
1
Hello Everyone, today I have another release, and it is 2 things,
1. Changing The Price Of The Mystery Box To Whatever You Want.
2. Hiding/Taking Away The Mystery Box

I have been trying to find a way to change the price of the Mystery Box for a while and finally found it, I also stumbled across a code that hides the Mystery Box!
So Here It Is Enjoy! :grinning:

Make Sure To Use This #include
#include maps/mp/zombies/_zm_magicbox;
Hide/Take Away Mystery Box
Code:
SetBoxHidden()
{
    i = 0;
    while(i < level.chests.size)
    {
        level.chests[ i ] hide_chest();
        level.chests[ level.chest_index ].hidden = 1;
        i++;
    }
    self iPrintln("Mystery Box ^2Hidden");
}


Set Mystery Box Price
Code:
SetBoxCost()
{
    i = 0;
    while (i < level.chests.size)
    {
        level.chests[ i ].zombie_cost = 50;
        level.chests[ i ].old_cost = 50;
        i++;
    }
    self iPrintln("Mystery Box Cost Set To ^250");
}


Set Mystery Box Price To Custom(Easier/Faster Way)
Code:
SetBoxCostCustom(cost)
{
    i = 0;
    while (i < level.chests.size)
    {
        level.chests[ i ].zombie_cost = cost;
        level.chests[ i ].old_cost = cost;
        i++;
    }
    self iPrintln("Mystery Box Cost Set To ^2"+cost+"");
}

Example For The Custom Mystery Box Price
Code:
self add_option("MainMods", "Set Box Cost To 10", ::SetBoxCostCustom, 10);

Credits:
CabCon(Didn't Realize He Already Found The hide_chest/show_chest)​
how would i make a function to move the box to a different location?
 

skywarp7

New Member
Messages
1
Reaction score
0
Points
1
Code:
oneWeaponInBox( weap )
{
    foreach(weapon in level.zombie_weapons)
        weapon.is_in_box = 0;
    wait .5; // need to wait for the above to complete;
    level.zombie_weapons[ weap ].is_in_box = 1;
    self iprintln(weap + " is now the only weapon in the mystery box.");
}

how to use
Code:
self addOpt("only HAMR in mystery box", ::oneWeaponInBox, "hamr_zm");
is there one for having only certain weapons in the box instead of one?
 
Top