Question Trying to make mod menu for BO3

Tyne

Member
Messages
11
Points
6
Whenever I build and run this mod, the objective was to toggle godmode every 10 seconds. I'm also trying out statements like "if (self fragButtonPressed())" but those don't seem to work either.
 

Attachments

noahisog

Well-Known Member
Messages
48
Points
208
good luck to you on getting any help...i don't know how to fix your problem sorry
 

TheHiddenHour

Well-Known Member
Messages
59
Points
228
Whenever I build and run this mod, the objective was to toggle godmode every 10 seconds. I'm also trying out statements like "if (self fragButtonPressed())" but those don't seem to work either.
Try this
Code:
#using scripts\codescripts\struct;
#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;
#using scripts\shared\array_shared;
#using scripts\shared\flag_shared;

#insert scripts\shared\shared.gsh;

#namespace clientids;

REGISTER_SYSTEM("clientids", &__init__, undefined)
    
function __init__()
{
    callback::on_start_gametype(&init);
    callback::on_connect(&on_player_connect);
    callback::on_spawned(&on_player_spawned);
}   

function init()
{
    level.clientid = 0;
}

function on_player_connect()
{
    self.clientid = matchRecordNewPlayer(self);
    if (!isDefined(self.clientid) || self.clientid == -1)
    {
        self.clientid = level.clientid;
        level.clientid++;
    }
}

function on_player_spawned()
{
    level flag::wait_till("initial_blackscreen_passed");
    self thread testFunc();
    self thread testGod();
}

function testFunc()
{
    for (;;)
    {
        if(self fragbuttonpressed())
            self iprintln("FRAG");
        wait 0.01;
    }
}

function testGod()
{
    for (;;)
    {
        toggleGodMode();
        wait 10;
    }
}

function toggleGodMode()
{
    if (!isDefined(self.gamevars["godmode"]) || !self.gamevars["godmode"])
    {
        self.gamevars["godmode"] = true;
        self enableInvulnerability();
        self iprintln("God Mode ^2ON");
    }
    else
    {
        self.gamevars["godmode"] = false;
        self disableInvulnerability();
        self iprintln("God Mode ^1OFF");
    }
}
 

noahisog

Well-Known Member
Messages
48
Points
208
sorry i dont play bo3 banned evertime i play lol...im trying to make bo2 non host sprx atm but so far i suck because im dumb
 

Tyne

Member
Messages
11
Points
6
Try this
Code:
#using scripts\codescripts\struct;
#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;
#using scripts\shared\array_shared;
#using scripts\shared\flag_shared;

#insert scripts\shared\shared.gsh;

#namespace clientids;

REGISTER_SYSTEM("clientids", &__init__, undefined)
   
function __init__()
{
    callback::on_start_gametype(&init);
    callback::on_connect(&on_player_connect);
    callback::on_spawned(&on_player_spawned);
}  

function init()
{
    level.clientid = 0;
}

function on_player_connect()
{
    self.clientid = matchRecordNewPlayer(self);
    if (!isDefined(self.clientid) || self.clientid == -1)
    {
        self.clientid = level.clientid;
        level.clientid++;
    }
}

function on_player_spawned()
{
    level flag::wait_till("initial_blackscreen_passed");
    self thread testFunc();
    self thread testGod();
}

function testFunc()
{
    for (;;)
    {
        if(self fragbuttonpressed())
            self iprintln("FRAG");
        wait 0.01;
    }
}

function testGod()
{
    for (;;)
    {
        toggleGodMode();
        wait 10;
    }
}

function toggleGodMode()
{
    if (!isDefined(self.gamevars["godmode"]) || !self.gamevars["godmode"])
    {
        self.gamevars["godmode"] = true;
        self enableInvulnerability();
        self iprintln("God Mode ^2ON");
    }
    else
    {
        self.gamevars["godmode"] = false;
        self disableInvulnerability();
        self iprintln("God Mode ^1OFF");
    }
}
That worked. Thanks.
 
Top