Answered How Can I Do This?

WolfieBlood

Known Member
Messages
3
Points
101
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:
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,300
Points
548
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:
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.
 

Saso

Well-Known Member
Messages
6
Points
201
What base is that, could you upload that?
it was never a released base, it was previewed on xTurntUpLobbies YT for Loz's base only i know a couple have and i have it just not how this guy has it where the title of the menu moves but you just add that in pretty easy
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,300
Points
548
it was never a released base, it was previewed on xTurntUpLobbies YT for Loz's base only i know a couple have and i have it just not how this guy has it where the title of the menu moves but you just add that in pretty easy
Nope, I just copied the design.
 
Top