1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question How Can I Do This?

Discussion in 'Call of Duty: Black Ops 2 Scripts' started by WolfieBlood, May 11, 2018.

  1. WolfieBlood

    WolfieBlood New Member

    1
    0
    1
    Credits:
    22
    I'm kinda new to coding but I'm making a bo2 mod menu, in it i want the next to change from off to on or back to off but I'm not sure how or if i even can.
    I've tried this:
    Code:
    if(self.god == false)
    {
    self add_option("mainMods", "God Mode ^1OFF^7", ::godMode);
    }
    else
    if(self.god == true)
    {
    self add_option("mainMods", "God Mode ^2ON^7", ::godMode);
    }
    but it stays as off :confused:
     
  2. Candy

    Candy G59 Terrorist Donator

    1,031
    700
    398
    Credits:
    5,678
    Yeah, you can't just add menu options lol.

    I just made this up real quick, should work fine. Just fix everything to match your base.
    Code:
    updateBools( text, menu, cursor )
    {
        if(!isDefined(menu)) menu = self getCurrentMenu();
        if(!isDefined(cursor)) cursor = self getCursor();
        self.menu_O[ menu ][ "option" ][ cursor ] = text;
        self setMenuText();
    }
    
    returnBool( var )
    {
        if(!isDefined(var))
            return "^1Off";
        else return "^2On";
    }
    Do your option like this
    Code:
    self add_option("mainMods", "God Mode " + self returnBool(self.godMode), ::godMode);
    Then finally your function like so.
    Code:
    godMode()
    {
        if(!isDefined(self.godMode))
        {
            self.godMode = true;
            self EnableInvulnerability();
        }
        else
        {
            self.godMode = undefined;
            self DisableInvulnerability();
        }
        self updateBools( "God Mode " + self returnBool( self.godMode ) );
    }
    The should to be outcome.
    [​IMG]
     
    Rezhified likes this.
  3. micromods

    micromods Member

    12
    5
    8
    Credits:
    186
    What base is that, could you upload that?
     

Share This Page