Modme Forums
Menu:

Perma Perk Issues

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


Kricket:

I've recently written code using a mix between NSZ shootable perk, and Ice Grenade's shootable easter egg code. After shooting 9 objects it gifts you mulekick, I was wondering how to make it that if this is done, it becomes a perma perk. Thanks in advance. The code works fine, just don't know how to keep it during the whole game. Here's my code:

function MuleKick()
{
    level.itemsRequired2 = 9; //change to number of shootable objects
    level.itemsCollected2 = 0;
    level thread itema();
    level thread itemb();
    level thread itemc();
    level thread itemd();
    level thread iteme();
    level thread itemf();
    level thread itemg();
    level thread itemh();
    level thread itemi();
    //Add additional items here
}
 
function itema()
{
    triga = GetEnt("ee_t1", "targetname");
    obja = GetEnt("ee_o1", "targetname");
    triga SetHintString("");
    triga SetCursorHint("HINT_NOICON");
    while(1)
    {
        triga waittill("trigger", player);
        level.itemsCollected2++;
        thread eeCheckDone2(player);
        break;
    }
    triga Delete();
    obja Delete();
}
 
function itemb()
{
    trigb = GetEnt("ee_t2", "targetname");
    objb = GetEnt("ee_o2", "targetname");
    trigb SetHintString("");
    trigb SetCursorHint("HINT_NOICON");
    while(1)
    {
        trigb waittill("trigger", player);
        level.itemsCollected2++;
        thread eeCheckDone2(player);
        break;
    }
    trigb Delete();
    objb Delete();
}
 
function itemc()
{
    trigc = GetEnt("ee_t3", "targetname");
    objc = GetEnt("ee_o3", "targetname");
    trigc SetHintString("");
    trigc SetCursorHint("HINT_NOICON");
    while(1)
    {
        trigc waittill("trigger", player);
        level.itemsCollected2++;
        thread eeCheckDone2(player);
        break;
    }
    trigc Delete();
    objc Delete();
}
function itemd()
{
    trigd = GetEnt("ee_t4", "targetname");
    objd = GetEnt("ee_o4", "targetname");
    trigd SetHintString("");
    trigd SetCursorHint("HINT_NOICON");
    while(1)
    {
        trigd waittill("trigger", player);
        level.itemsCollected2++;
        thread eeCheckDone2(player);
        break;
    }
    trigd Delete();
    objd Delete();
}
 
function iteme()
{
    trige = GetEnt("ee_t5", "targetname");
    obje = GetEnt("ee_o5", "targetname");
    trige SetHintString("");
    trige SetCursorHint("HINT_NOICON");
    while(1)
    {
        trige waittill("trigger", player);
        level.itemsCollected2++;
        thread eeCheckDone2(player);
        break;
    }
    trige Delete();
    obje Delete();
}
 
function itemf()
{
    trigf = GetEnt("ee_t6", "targetname");
    objf = GetEnt("ee_o6", "targetname");
    trigf SetHintString("");
    trigf SetCursorHint("HINT_NOICON");
    while(1)
    {
        trigf waittill("trigger", player);
        level.itemsCollected2++;
        thread eeCheckDone2(player);
        break;
    }
    trigf Delete();
    objf Delete();
}
function itemg()
{
    trigg = GetEnt("ee_t7", "targetname");
    objg = GetEnt("ee_o7", "targetname");
    trigg SetHintString("");
    trigg SetCursorHint("HINT_NOICON");
    while(1)
    {
        trigg waittill("trigger", player);
        level.itemsCollected2++;
        thread eeCheckDone2(player);
        break;
    }
    trigg Delete();
    objg Delete();
}
 
function itemh()
{
    trigh = GetEnt("ee_t8", "targetname");
    objh = GetEnt("ee_o8", "targetname");
    trigh SetHintString("");
    trigh SetCursorHint("HINT_NOICON");
    while(1)
    {
        trigh waittill("trigger", player);
        level.itemsCollected2++;
        thread eeCheckDone2(player);
        break;
    }
    trigh Delete();
    objh Delete();
}
 
function itemi()
{
    trigi = GetEnt("ee_t9", "targetname");
    obji = GetEnt("ee_o9", "targetname");
    trigi SetHintString("");
    trigi SetCursorHint("HINT_NOICON");
    while(1)
    {
        trigi waittill("trigger", player);
        level.itemsCollected2++;
        thread eeCheckDone2(player);
        break;
    }
    trigi Delete();
    obji Delete();
}
function eeCheckDone2(player)
{
    while(1)
    {
        self waittill(level.shootablesCollected2 >= level.itemsRequired2);
        if(level.itemsCollected2 == level.itemsRequired2)
        {
            //self playlocalsound( level.zmb_laugh_alias ); Not working atm
            players = getplayers();
            for( i=0;i<players.size;i++ )
            {
                players[i] thread give_all_perks();
            }
        }
        break;
    }
}

function give_all_perks()
{
    self zm_perks::give_perk("specialty_additionalprimaryweapon", true);
    wait(0.1);
    
}


tmk_boi:

just saying the samanthas laugh is called zmb_child_laughnot level.zmb_laugh_alias


Kricket:

just saying the samanthas laugh is called zmb_child_laugh not level.zmb_laugh_alias

Thanks for letting me know, the tutorial I watched had the wrong name, so I just left it commented out.