Post: How Can I Do This?
05-12-2018, 12:27 AM #1
wolfieblood
Save Point
(adsbygoogle = window.adsbygoogle || []).push({}); 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:
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? :/
08-30-2018, 08:24 PM #2
xSins
Bounty hunter
This is all wrong. You do not call the function inside of the function. So it should be like this

Sub Option:

    self add_option("mainMods", "God Mode", ::godMode);


Function:

    
godMode()
{
if(godMode == false)
{
self enableInvulnerability();
}
else
{
self disableInvulnerability();
}
}


Hope this helped.

The following user groaned xSins for this awful post:

Patrick
09-02-2018, 05:43 PM #3
Patrick
League Champion
self add_option("mainMods", "God Mode " + ( self.god ? "^2ON^7" : "^1OFF^7" ), ::godMode);
10-26-2018, 11:54 PM #4
Iwau
Gobble
Code: self add_option("SubMenu1", "God Mode", ::GodMode);

Function:

GodMode()
{
if(self.GM == false)
{
self EnableInvulnerability();
self.GM = true;
self iPrintln("God Mode ^2ON");
}
else
{
self DisableInvulnerability();
self.GM = false;
self iPrintln("God Mode ^1OFF");
}

The following user groaned Iwau for this awful post:

anthonything

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo