UGX-Mods

Call of Duty: Black Ops 3 => Tutorial Desk => Scripting => Topic started by: hajhaka on November 24, 2016, 10:47:18 am

Title: God Mode Trigger
Post by: hajhaka on November 24, 2016, 10:47:18 am
Hello guys and zombie modders!
Today im gonna release my god mode script
What it does is it gives the player ability to buy god mod for 10 minutes
You can edit the time for how long you want the player to have god mode
and edit the price
Thanks to natesmithzombies for fixing the script and helping me


Make sure to add
Code Snippet
Plaintext
#using scripts\zm\_zm_score;

at the top of your mapname.gsc

Installation add the script down below to your mapname.gsc

go to
Code Snippet
Plaintext
zm_usermap::main();
and add
Code Snippet
Plaintext
level thread givegod();

Then open radiant make a trigger_use and simpely use the target name GetGod


Code Snippet
Plaintext
function givegod()
{
    trigger = GetEnt("GetGod", "targetname");
    trigger SetHintString("Press ^3&&1^7 For GOD MODE");
    trigger SetCursorHint("HINT_NOICON");
    GodCost = 1000; // Edit the value to change how mutch points its gonna cost

     
    while(1)
    {
        trigger waittill("trigger", player);
   
        if(player.score >= GodCost && !isDefined(player.is_god))
        {
            player zm_score::minus_to_player_score(GodCost);
            player PlayLocalSound( "cha_ching" );
            player EnableInvulnerability();
            player.is_god = true;
            trigger SetHintStringForPlayer( player, "You Are Already in God Mode" );
            player thread god_cooldown(trigger);
            wait(2);
        }
        else if( isDefined(player.is_god) && player.is_god )
        {
             
        }
        else
        {
            trigger SetHintStringForPlayer( player, "You Need "+GodCost+" points to Enable God Mode" );
            trigger PlayLocalSound ( "deny" );
            wait(2);
            trigger SetHintStringForPlayer(player, "Press ^3&&1^7 For GOD MODE");
        }
    }
}
 
function god_cooldown(trigger)
{
    wait(600); // Edit this for the cooldown value 1 = 1 second
    trigger SetHintStringForPlayer(self, "Press ^3&&1^7 For GOD MODE");
    self.is_god = undefined;
    self DisableInvulnerability();
    self iprintlnbold( "God Mode Disabled" );
}

Thats it it would be nice with a credit but up to you lol  :nyan:
Have Fun!
If ur gonna credit me use name "m1cke"
Title: Re: God Mode Trigger
Post by: Blink-420 on November 24, 2016, 04:48:45 pm
Didnt natesmithzombies make this script????

Double Post Merge: November 24, 2016, 05:04:55 pm
Didnt natesmithzombies make this script????

Nevermind I didnt read the whole post lol... my bad
Title: Re: God Mode Trigger
Post by: hajhaka on November 24, 2016, 05:13:06 pm
he did help getting me started but i made the start  :'(
Title: Re: God Mode Trigger
Post by: Blink-420 on November 24, 2016, 05:17:30 pm
he did help getting me started but i made the start  :'(

Yeah I saw and replied to modme but you have a different username so I thought someone was taking credit..lol good job :)
Title: Re: God Mode Trigger
Post by: hajhaka on November 24, 2016, 05:21:42 pm
Thanks :)
Title: Re: God Mode Trigger
Post by: Cxwh on December 02, 2016, 04:11:26 pm
Why did you call 'giveGod' on level? You can also do
Code Snippet
Plaintext
thread giveGod();
Title: Re: God Mode Trigger
Post by: hajhaka on December 02, 2016, 06:19:29 pm
Does that really matter obviously i know you can
Code Snippet
Plaintext
thread
insted of
Code Snippet
Plaintext
level thread
Its my first script and i used another script as reference so sorry if i used it the wrong way
Title: Re: God Mode Trigger
Post by: Cxwh on December 02, 2016, 06:36:24 pm
Sorry, I didn't want to be rude, I just want to help people get the idea of ents and what they're here for
Title: Re: God Mode Trigger
Post by: hajhaka on December 02, 2016, 07:20:04 pm
Yea i understand that but if u check my speed trigger u can se that i use
Code Snippet
Plaintext
thread speedmode()