UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: hajhaka on November 22, 2016, 09:24:55 pm

Title: whats wrong with my god mod trigger
Post by: hajhaka on November 22, 2016, 09:24:55 pm
I made this script when i was board but it dosen't give me god mod
and when i buy it the trigger dosen't dissaper like it still says press f for god mod
thanks for eny help
Code Snippet
Plaintext
function givegod()
{
trigger = GetEnt("GetGod", "targetname");
trigger SetHintString("Press ^3&&1^7 For GOD MODE");
trigger SetCursorHint("HINT_NOICON");
GodCost = 1000;
trigger waittill("trigger", player);

if(player.score >= GodCost)
{
player zm_score::minus_to_player_score(GodCost);
trigger PlayLocalSound( "cha_ching" );
ModVar( "god", 1 );
break;
}
else
{
trigger PlayLocalSound ( "deny" );
}
}
Title: Re: whats wrong with my god mod trigger
Post by: Dust on November 22, 2016, 09:51:09 pm
To make the trigger disappear after you use it, you need to do trigger delete(); or trigger TriggerEnable(false); (True will enable it again.

Also I am not too familar with changing dvars via script on BO3, but to use the cheat via console you need to do /god, so maybe you just need to add the / before god in the script.
Title: Re: whats wrong with my god mod trigger
Post by: hajhaka on November 22, 2016, 10:00:21 pm
To make the trigger disappear after you use it, you need to do trigger delete(); or trigger TriggerEnable(false); (True will enable it again.

Also I am not too familar with changing dvars via script on BO3, but to use the cheat via console you need to do /god, so maybe you just need to add the / before god in the script.

where should i add the TriggerEnable(false);?

Double Post Merge: November 22, 2016, 10:06:45 pm
thanks dust tho i still can't get god mode working
Title: Re: whats wrong with my god mod trigger
Post by: Dust on November 22, 2016, 10:08:09 pm
where should i add the TriggerEnable(false);?

Double Post Merge: November 22, 2016, 10:06:45 pm
thanks dust tho i still can't get god mode working

After the trigger waittill

And not sure why the dvar code isnt working, maybe someone more experienced can help.
Title: Re: whats wrong with my god mod trigger
Post by: hajhaka on November 22, 2016, 10:19:33 pm
well see
Title: Re: whats wrong with my god mod trigger
Post by: Cxwh on November 30, 2016, 05:20:03 pm
You don't have to use Dvars to do stuff like this... Try to get creative and work around problems

Call one of them when the trigger gets triggered
Code Snippet
Plaintext
//I'm pretty sure self.god = !self.god works in gsc if not just make a functions that returns the opposite state or bool or idk
function godmode()
{
self.god = !self.god;
if(self.god)
self thread monitor_health();
else
self notify("end_godmode");
self.god = !self.god;
}
function monitor_health()
{
self endon("end_godmode");

self.maxhealth = 9999999;
while(self.health != self.maxhealth)
{
self.health = self.maxhealth;
wait 0.1;
}
}

//or even more simple use engine functions
function godmode()
{
self.god = !self.god;
if(self.god)
self EnableInvulnerability();
else
self DisableInvulnerability();
}
These scripts aslo toggle godmode so you can call them again to disable godmode again
Title: Re: whats wrong with my god mod trigger
Post by: BluntStuffy on November 30, 2016, 05:38:02 pm
This one will break out oif the while loop as soon as self.health == self.maxhealth, so that wont be very usefull..

Code Snippet
Plaintext
function monitor_health()
{
self endon("end_godmode");

self.maxhealth = 9999999;
while(self.health != self.maxhealth)
{
self.health = self.maxhealth;
wait 0.1;
}
}


Title: Re: whats wrong with my god mod trigger
Post by: hajhaka on November 30, 2016, 05:39:03 pm
Fixed this looooong time ago