Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] can't get last cooldown to work in game?

[Support] can't get last cooldown to work in game?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
gscblack ops 2
17 Posts 7 Posters 2.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Jax Jax

    treyful said in can't get last cooldown to work in game?:

    download.png download (1).png
    im calling it through onplayerspawned and also have the functions above. if someone could help id appreciate it.

    I would add the script on the snipers in onPlayerDamage

    treyful Offline
    treyful Offline
    treyful
    wrote on last edited by
    #4

    Jax which part of the script?

    1 Reply Last reply
    0
    • Jax Offline
      Jax Offline
      Jax
      Contributor
      wrote on last edited by
      #5

      the last cool down thread

      1 Reply Last reply
      0
      • Ducxy Offline
        Ducxy Offline
        Ducxy
        wrote on last edited by
        #6

        I have a working last cooldown if needed

        1 Reply Last reply
        0
        • Ducxy Offline
          Ducxy Offline
          Ducxy
          wrote on last edited by
          #7
          onLastReached() {
              self endon( "disconnect" );
              self endon( "cooldownSet" );
             
              self.lastCooldown = true;
                 
              for(;;) {
                  if( self.lastCooldown && ((level.scorelimit - self.pers["kills"]) == 1) ) {
                      self.lastCooldown = false;
                      self freezeControls( true );
                      self enableInvulnerability();
                      self iPrintlnBold("^4YOU'RE ON LAST!");
                      wait 1.25;
                      self freezeControls( false );
                      self disableInvulnerability();
                      self notify( "cooldownSet" );
                  }
                 
                  wait 0.25;
              }
          }
          
          Matrix treyful 2 Replies Last reply
          0
          • Ducxy Ducxy
            onLastReached() {
                self endon( "disconnect" );
                self endon( "cooldownSet" );
               
                self.lastCooldown = true;
                   
                for(;;) {
                    if( self.lastCooldown && ((level.scorelimit - self.pers["kills"]) == 1) ) {
                        self.lastCooldown = false;
                        self freezeControls( true );
                        self enableInvulnerability();
                        self iPrintlnBold("^4YOU'RE ON LAST!");
                        wait 1.25;
                        self freezeControls( false );
                        self disableInvulnerability();
                        self notify( "cooldownSet" );
                    }
                   
                    wait 0.25;
                }
            }
            
            Matrix Offline
            Matrix Offline
            Matrix
            Plutonium Staff
            wrote on last edited by
            #8

            @MrDucxy said in can't get last cooldown to work in game?:

            onLastReached() {
                self endon( "disconnect" );
                self endon( "cooldownSet" );
               
                self.lastCooldown = true;
                   
                for(;;) {
                    if( self.lastCooldown && ((level.scorelimit - self.pers["kills"]) == 1) ) {
                        self.lastCooldown = false;
                        self freezeControls( true );
                        self enableInvulnerability();
                        self iPrintlnBold("^4YOU'RE ON LAST!");
                        wait 1.25;
                        self freezeControls( false );
                        self disableInvulnerability();
                        self notify( "cooldownSet" );
                    }
                   
                    wait 0.25;
                }
            }
            

            looks familiar 😛

            Ducxy 1 Reply Last reply
            0
            • Matrix Matrix

              @MrDucxy said in can't get last cooldown to work in game?:

              onLastReached() {
                  self endon( "disconnect" );
                  self endon( "cooldownSet" );
                 
                  self.lastCooldown = true;
                     
                  for(;;) {
                      if( self.lastCooldown && ((level.scorelimit - self.pers["kills"]) == 1) ) {
                          self.lastCooldown = false;
                          self freezeControls( true );
                          self enableInvulnerability();
                          self iPrintlnBold("^4YOU'RE ON LAST!");
                          wait 1.25;
                          self freezeControls( false );
                          self disableInvulnerability();
                          self notify( "cooldownSet" );
                      }
                     
                      wait 0.25;
                  }
              }
              

              looks familiar 😛

              Ducxy Offline
              Ducxy Offline
              Ducxy
              wrote on last edited by
              #9

              Matrix ahaha 😛 yessir it does look familiar doesnt it

              1 Reply Last reply
              0
              • Ducxy Ducxy
                onLastReached() {
                    self endon( "disconnect" );
                    self endon( "cooldownSet" );
                   
                    self.lastCooldown = true;
                       
                    for(;;) {
                        if( self.lastCooldown && ((level.scorelimit - self.pers["kills"]) == 1) ) {
                            self.lastCooldown = false;
                            self freezeControls( true );
                            self enableInvulnerability();
                            self iPrintlnBold("^4YOU'RE ON LAST!");
                            wait 1.25;
                            self freezeControls( false );
                            self disableInvulnerability();
                            self notify( "cooldownSet" );
                        }
                       
                        wait 0.25;
                    }
                }
                
                treyful Offline
                treyful Offline
                treyful
                wrote on last edited by
                #10

                @MrDucxy still doesn't work. should i be calling it through onplayerspawned still?

                Jax Ducxy 2 Replies Last reply
                0
                • treyful treyful

                  @MrDucxy still doesn't work. should i be calling it through onplayerspawned still?

                  Jax Offline
                  Jax Offline
                  Jax
                  Contributor
                  wrote on last edited by
                  #11

                  treyful

                  you call the thread when they do damage

                  1 Reply Last reply
                  0
                  • treyful treyful

                    @MrDucxy still doesn't work. should i be calling it through onplayerspawned still?

                    Ducxy Offline
                    Ducxy Offline
                    Ducxy
                    wrote on last edited by Ducxy
                    #12

                    treyful call it through onplayerconnect

                    1 Reply Last reply
                    0
                    • Jax Jax

                      treyful said in can't get last cooldown to work in game?:

                      download.png download (1).png
                      im calling it through onplayerspawned and also have the functions above. if someone could help id appreciate it.

                      I would add the script on the snipers in onPlayerDamage

                      mikzy Offline
                      mikzy Offline
                      mikzy
                      Banned
                      wrote on last edited by
                      #13
                      This post is deleted!
                      1 Reply Last reply
                      0
                      • mikzy Offline
                        mikzy Offline
                        mikzy
                        Banned
                        wrote on last edited by mikzy
                        #14
                        This post is deleted!
                        1 Reply Last reply
                        0
                        • treyful treyful

                          download.png download (1).png
                          im calling it through onplayerspawned and also have the functions above. if someone could help id appreciate it.

                          Zedkays Offline
                          Zedkays Offline
                          Zedkays
                          wrote on last edited by
                          #15

                          treyful did you ever get it to work. I'm struggling...

                          mikzy 2 Replies Last reply
                          0
                          • Zedkays Zedkays

                            treyful did you ever get it to work. I'm struggling...

                            mikzy Offline
                            mikzy Offline
                            mikzy
                            Banned
                            wrote on last edited by
                            #16
                            This post is deleted!
                            1 Reply Last reply
                            0
                            • Zedkays Zedkays

                              treyful did you ever get it to work. I'm struggling...

                              mikzy Offline
                              mikzy Offline
                              mikzy
                              Banned
                              wrote on last edited by mikzy
                              #17

                              Zedkays Dont mind messy code but here's how you would do barrel stuff protection, snipers only, and Last Cooldown.

                              On your init, put level.onPlayerDamage = ::onPlayerDamage;

                              Then, somewhere in your script, put this.

                              onplayerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime )
                              {
                              	weaponClass = self getWeaponClass( sweapon );
                              	if(weaponClass == "weapon_sniper")
                              	{
                              		if((int(distance(self.origin, eattacker.origin)*0.0254) < 20 ) && eattacker.pers["kills"] == 9 ) // barrel stuff protection
                              		{
                              			iDamage = 0; // barrel stuff protection ON and last = true
                              		}
                              		else
                              		{
                              			self.health = 1;
                              			
                              			/* ^^ It's a Barrel Stuff but since Person isn't on last,
                              			we are going to make the Victim's health still 1 so they
                              			can get to last. */
                              			
                              			if (smeansofdeath != "MOD_SUICIDE" && smeansofdeath != "MOD_TRIGGER_HURT" && ((level.scorelimit - eattacker.pers["kills"]) == 2) )
                              			{
                              				eattacker thread onLastReached();
                              			}
                              			
                              			/* ^^ If Suicide or Trigger_Hurt, the Last Reached thread
                              			will not be called. But, if not Suicide or Trigger_Hurt and
                              			Person is 1 kill away from last, lets thread the onlastreach
                              			(Last Cooldown) to let them know they are at last. */
                              			
                              		}
                              	}
                              	return iDamage;
                              }
                              
                              onLastReached() 
                              {
                                  self endon( "disconnect" );
                                  self endon( "cooldownSet" );
                                     
                                  for(;;) 
                              	{
                              	self freezeControls( true );
                              	self iprintlnbold("Last ^2Cooldown");
                                      wait 1.5;
                                      self freezeControls( false );
                                      self notify( "cooldownSet" );
                              	}
                              }
                              
                              1 Reply Last reply
                              0

                              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                              With your input, this post could be even better 💗

                              Register Login
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Unread 0
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Donate