UGX-Mods

Call of Duty: Black Ops 3 => Tutorial Desk => Scripting => Topic started by: hajhaka on November 24, 2016, 08:43:19 pm

Title: Super Speed script
Post by: hajhaka on November 24, 2016, 08:43:19 pm
Hello everyone today im gonna release my 2nd script in 1 day wowwowow  :rainbow:
So this one is really simular to my last one but it gives you speed
Installation:

add
Code Snippet
Plaintext
#using scripts\zm\_zm_score;

at the top of your mapname.gsc

here
Code Snippet
Plaintext
zm_usermap::main();

add this underneeth
Code Snippet
Plaintext
thread speed();

Make a trigger_use in Radiant
give it target name SpeedTrigger

Add this at the bottom of your mapname.gsc

Code Snippet
Plaintext
function speed()
{
    trigger = GetEnt("SpeedTrigger", "targetname");
    trigger SetHintString("Press ^3&&1^7 For Speed [cost 10000");
    trigger SetCursorHint("HINT_NOICON");
    SpeedCost = 10000; // Edit the value to change how mutch points its gonna cost

     
    while(1)
    {
        trigger waittill("trigger", player);
   
        if(player.score >= SpeedCost && !isDefined(player.is_speed))
        {
            player zm_score::minus_to_player_score(SpeedCost);
            player PlayLocalSound( "cha_ching" );
            player SetMoveSpeedScale(2);
            player.is_speed = true;
            trigger SetHintStringForPlayer( player, "You Are Already in Speed Mode" );
            player iprintlnbold("Speed mode for 10 minutes GO SUPER SAIYAN");
            player thread speed_cooldown(trigger);
            wait(2);
        }
        else if( isDefined(player.is_speed) && player.is_speed )
        {
             
        }
        else
        {
            trigger SetHintStringForPlayer( player, "You Need "+SpeedCost+" points to Enable Speed Mode" );
            trigger PlayLocalSound ( "deny" );
            wait(2);
            trigger SetHintStringForPlayer(player, "Press ^3&&1^7 For Speed Mode");
        }
    }
}

function speed_cooldown(trigger)
{
    wait(600); // Edit this for the cooldown value 1 = 1 second
    self.is_speed = undefined;
    self SetMoveSpeedScale(1);
    self iprintlnbold( "Speed Mode Disabled You can buy again in 45 sec" );
    trigger SetHintStringForPlayer( self, "Comback later!" );
    wait (45);
    trigger SetHintStringForPlayer(self, "Press ^3&&1^7 For Speed Mode [Cost 10000");
}

For this script i have added a cooldown so the player have to wait 45 seconds before buying the trigger again
U can remove this by changing
This
Code Snippet
Plaintext
function speed_cooldown(trigger)
{
    wait(600); // Edit this for the cooldown value 1 = 1 second
    self.is_speed = undefined;
    self SetMoveSpeedScale(1);
    self iprintlnbold( "Speed Mode Disabled You can buy again in 45 sec" );
    trigger SetHintStringForPlayer( self, "Comback later!" );
    wait (45);
    trigger SetHintStringForPlayer(self, "Press ^3&&1^7 For Speed Mode [Cost 10000");
}

to this
Code Snippet
Plaintext
function speed_cooldown(trigger)
{
    wait(600); // Edit this for the cooldown value 1 = 1 second
    self.is_speed = undefined;
    self SetMoveSpeedScale(1);
    self iprintlnbold( "Speed Mode Disabled" );
    trigger SetHintStringForPlayer(self, "Press ^3&&1^7 For Speed Mode [Cost 10000");
}

credit me if u want but its up to you
Have Fun!  :nyan:
But if ur gonna credit me use name "m1cke"
Title: Re: Super Speed script
Post by: CraftDAnimations on November 25, 2016, 03:44:43 am
I just installed this on my main test map and it worked fine.  But when I came to installing it in a BLANK new map I get this error when compiling

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fimage.prntscr.com%2Fimage%2F5a81d4e81c254086bb850cba8d3277e7.png&hash=62fa64bbed110f5a74ec884818021e3e22842844)
Title: Re: Super Speed script
Post by: MakeCents on November 25, 2016, 04:39:25 am
I just installed this on my main test map and it worked fine.  But when I came to installing it in a BLANK new map I get this error when compiling

(http://image.prntscr.com/image/5a81d4e81c254086bb850cba8d3277e7.png)

That error most likely is due to you putting it in a new gsc. Your are probably missing this at the top, which is already in mapname.gsc.
Code Snippet
Plaintext
#using scripts\zm\_zm_score;
Title: Re: Super Speed script
Post by: hajhaka on November 25, 2016, 06:27:14 am
Yeah sorry about that i forgot about needing to include zm_score im gonna update ty make cents