Script for making perma Jug not stack?

Topic created · 3 Posts · 74 Views
  • 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.

  • @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;
    			}
    		}
    	}
    }
    
  • @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.

Log in to reply