Modme Forums

Add box weapons mid-game

Game Modding | Call of Duty: Black Ops 3 | Scripting


ihmiskeho:

As the title suggests, I'm trying to add box weapons mid-game (so setting in_box to true from levelcommon weapons is not an option). Here's what I have, all prints show on screen (Basing these off soe idgun scripts I got via Cerberus)

Gsc side:

function SetupClassicMode()
{
    level waittill("gamemode_chosen");
    //IPrintLnBold("Gamemode chosen");
    if(isdefined(level.CurrentGameMode) && level.CurrentGameMode != "zm_normal")
    {
        IPrintLnBold("Adding box weapons");
        level clientfield::set("add_elemental_weapons", 1);

        zm_utility::include_weapon("spell_wind_ug", 1);
        zm_utility::include_weapon("spell_lightning_ug", 1);
        zm_utility::include_weapon("spell_ice_ug", 1);
        zm_utility::include_weapon("spell_fire_ug", 1);
       
    }
}

Csc side:
function add_elemental_weapons( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
{
    if(newVal == 1)
    {
        AddZombieBoxWeapon(GetWeapon("spell_wind_ug"),GetWeapon("spell_wind_ug").worldmodel, false);
        AddZombieBoxWeapon(GetWeapon("spell_ice_ug"),GetWeapon("spell_ice_ug").worldmodel , false);
        AddZombieBoxWeapon(GetWeapon("spell_lightning_ug"),GetWeapon("spell_lightning_ug").worldmodel , false);
        AddZombieBoxWeapon(GetWeapon("spell_fire_ug"),GetWeapon("spell_fire_ug").worldmodel , false);
       
        IPrintlnBold("Added Weapons");
    }
   
}

Any help is appreciated, thanks