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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Script for making perma Jug not stack?

Script for making perma Jug not stack?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
3 Posts 2 Posters 436 Views
  • 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.
  • Dragon115 Offline
    Dragon115 Offline
    Dragon115
    wrote on last edited by
    #1

    Perma jug stacking with jug is a little strong imo and I wanted to change it any ideas? I tried creating an if statement to check for the player health being at 340 and setting it to 250 but it didn't work. Any advice is appeciated.

    JezuzLizard 1 Reply Last reply
    0
    • Dragon115 Dragon115

      Perma jug stacking with jug is a little strong imo and I wanted to change it any ideas? I tried creating an if statement to check for the player health being at 340 and setting it to 250 but it didn't work. Any advice is appeciated.

      JezuzLizard Offline
      JezuzLizard Offline
      JezuzLizard
      Plutonium Staff
      wrote on last edited by
      #2

      Dragon115
      Try this code:

      main()
      {
      	replaceFunc( maps/mp/zombies/_zm_perks::perk_set_max_health_if_jugg, ::perk_set_max_health_if_jugg_override );
      }
      
      perk_set_max_health_if_jugg_override( perk, set_premaxhealth, clamp_health_to_max_health ) //checked matches cerberus output
      {
      	max_total_health = undefined;
      	if ( perk == "specialty_armorvest" )
      	{
      		if ( set_premaxhealth )
      		{
      			self.premaxhealth = self.maxhealth;
      		}
      		max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
      	}
      	else if ( perk == "specialty_armorvest_upgrade" )
      	{
      		if ( set_premaxhealth )
      		{
      			self.premaxhealth = self.maxhealth;
      		}
      		max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health_upgrade" ];
      	}
      	else if ( perk == "jugg_upgrade" )
      	{
      		if ( set_premaxhealth )
      		{
      			self.premaxhealth = self.maxhealth;
      		}
      		if ( self hasperk( "specialty_armorvest" ) )
      		{
      			max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
      		}
      		else
      		{
      			max_total_health = 100;
      		}
      	}
      	else
      	{
      		if ( perk == "health_reboot" )
      		{
      			max_total_health = 100;
      		}
      	}
      	if ( isDefined( max_total_health ) )
      	{
      		if ( self maps/mp/zombies/_zm_pers_upgrades_functions::pers_jugg_active() && !hasPerk( "specialty_armorvest" ) )
      		{
      			max_total_health += level.pers_jugg_upgrade_health_bonus;
      		}
      		self setmaxhealth( max_total_health );
      		if ( isDefined( clamp_health_to_max_health ) && clamp_health_to_max_health == 1 )
      		{
      			if ( self.health > self.maxhealth )
      			{
      				self.health = self.maxhealth;
      			}
      		}
      	}
      }
      
      Dragon115 1 Reply Last reply
      1
      • JezuzLizard JezuzLizard

        Dragon115
        Try this code:

        main()
        {
        	replaceFunc( maps/mp/zombies/_zm_perks::perk_set_max_health_if_jugg, ::perk_set_max_health_if_jugg_override );
        }
        
        perk_set_max_health_if_jugg_override( perk, set_premaxhealth, clamp_health_to_max_health ) //checked matches cerberus output
        {
        	max_total_health = undefined;
        	if ( perk == "specialty_armorvest" )
        	{
        		if ( set_premaxhealth )
        		{
        			self.premaxhealth = self.maxhealth;
        		}
        		max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
        	}
        	else if ( perk == "specialty_armorvest_upgrade" )
        	{
        		if ( set_premaxhealth )
        		{
        			self.premaxhealth = self.maxhealth;
        		}
        		max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health_upgrade" ];
        	}
        	else if ( perk == "jugg_upgrade" )
        	{
        		if ( set_premaxhealth )
        		{
        			self.premaxhealth = self.maxhealth;
        		}
        		if ( self hasperk( "specialty_armorvest" ) )
        		{
        			max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
        		}
        		else
        		{
        			max_total_health = 100;
        		}
        	}
        	else
        	{
        		if ( perk == "health_reboot" )
        		{
        			max_total_health = 100;
        		}
        	}
        	if ( isDefined( max_total_health ) )
        	{
        		if ( self maps/mp/zombies/_zm_pers_upgrades_functions::pers_jugg_active() && !hasPerk( "specialty_armorvest" ) )
        		{
        			max_total_health += level.pers_jugg_upgrade_health_bonus;
        		}
        		self setmaxhealth( max_total_health );
        		if ( isDefined( clamp_health_to_max_health ) && clamp_health_to_max_health == 1 )
        		{
        			if ( self.health > self.maxhealth )
        			{
        				self.health = self.maxhealth;
        			}
        		}
        	}
        }
        
        Dragon115 Offline
        Dragon115 Offline
        Dragon115
        wrote on last edited by
        #3

        JezuzLizard Actually figured it out by having the script check for if you bought jug and set your health to 250. I appreciate this though because it helps me learn.

        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