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

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. [Release] Shield Hud BO2 Zombies

[Release] Shield Hud BO2 Zombies

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
4 Posts 3 Posters 209 Views 1 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.
  • Just_Lettu Offline
    Just_Lettu Offline
    Just_Lettu
    wrote last edited by
    #1

    Hi There! This is my first time creating and sharing a script mod!

    This mod is an update to the existing file obtained from
    TomasFreeman15 post, and the original mod is from teh_bandit.

    I don't know how to compile scripts, so I'm sharing the raw uncompiled text—but it works anyway!.

    Description:

      1. Shield Health: I ran some tests and I noticed the shield's health in TranZit is higher than in later maps (MOTD and Origins); the shield's health in TranZit keeps at 2250, whereas in the other maps it is 1500.
      1. Shield Meter Value: In the original script, a fixed numerical value was displayed (which also adjusts automatically based on the map, as I mentioned earlier); I thought it would be more "better" to scale the shield health from 0 to 100 and have the color change (Green, Yellow, and Red) depending on the shield's damage recieved.
      1. Label: It seems to me that TranZit lacks a native shader specifically for the shield UI—which is why an icon couldn't be used there—so I opted to replace it and use the static "Shield" label instead.

    And that’s it! I hope you find this useful. I decided to place this label on the right side of the screen so it wouldn't interfere with other mods that also display on-screen information.

    Location you need to put the Script for it to work:

    AppData\Local\Plutonium\storage\t6\scripts\zm\shield meter-uncompiled.gsc
    

    SCRIPT:

    #include maps\mp\_utility;
    #include common_scripts\utility;
    #include maps\mp\zombies\_zm_utility;
    #include maps\mp\gametypes_zm\_hud_util;
    
    init()
    {
    	level thread onPlayerConnect();
    }
    
    onPlayerConnect()
    {
    	for(;;)
    	{
    		level waittill("connected", player);
    		player iprintln("^1Shield Meter Loaded");
    		player thread onPlayerSpawned();
    	}
    }
    
    onPlayerSpawned()
    {
    	level endon("end_game");
    	self endon("disconnect");
    	for(;;)
    	{
    		self waittill("spawned_player");
    		self thread shield_hud();
    	}
    }
    
    shield_hud()
    {
    	self endon("disconnect");
    	flag_wait("initial_blackscreen_passed");
    
    	shield_label = newClientHudElem(self);
    	shield_label.alignx = "right";
    	shield_label.aligny = "bottom";
    	shield_label.horzalign = "user_right";
    	shield_label.vertalign = "user_bottom";
    
    	shield_label.x = -75;
    	shield_label.y = -225;
    
    	shield_label.hidewheninmenu = 1;
    	shield_label.fontscale = 1.7;
    	shield_label.alpha = 0;
    	shield_label settext("Shield: "); 
    
    	shield_text = newClientHudElem(self);
    	shield_text.alignx = "right";
    	shield_text.aligny = "bottom";
    	shield_text.horzalign = "user_right";
    	shield_text.vertalign = "user_bottom";
    	
    	shield_text.x = -55; 
    	shield_text.y = -225; 
    	
    	shield_text.hidewheninmenu = 1;
    	shield_text.fontscale = 1.7; 
    	shield_text.alpha = 0;
    	
    	max_health = 1500;
    	map = getdvar("mapname");
    	
    	if(map == "zm_transit") { max_health = 2250; }
    
    	for(;;)
    	{
    		if (self hasweapon("riotshield_zm") || self hasweapon("alcatraz_shield_zm") || self hasweapon("tomb_shield_zm") )
    		{
    			shield_label.alpha = 1;
    			shield_text.alpha = 1;
    		}
    		else
    		{
    			shield_label.alpha = 0;
    			shield_text.alpha = 0;
    		}
    		
    		if (!isdefined(self.shielddamagetaken)) 
    		{
    			self.shielddamagetaken = 0;
    		}
    
    		pct = int( ((max_health - self.shielddamagetaken) / max_health) * 100 );
    		
    		if (pct < 0)
    		{
    			shield_text setvalue(0);
    		}
    		else
    		{
    			shield_text setvalue(pct);
    		}
    		
    		if (pct > 66) { shield_text.color = (0.2, 1, 0.2); } 
    		else if (pct > 33) { shield_text.color = (1, 1, 0.2); } 
    		else { shield_text.color = (1, 0.2, 0.2); } 
    		
    		wait 0.05;
    		
    		if(self.shielddamagetaken >= max_health)
    		{
    			shield_text.alpha = 0;
    			shield_label.alpha = 0;
    		}
    	}
    }
    

    SCREENSHOTS:Captura de pantalla 2026-09-14 131723.png Captura de pantalla 2026-09-14 131738.png Captura de pantalla 2026-09-14 132444.png Captura de pantalla 2026-09-14 133743.png

    1 Reply Last reply
    1
    • SkyStar300 Offline
      SkyStar300 Offline
      SkyStar300
      wrote last edited by
      #2

      I love it—it's simple and effective. Do you think it would be possible to place the shield health meter next to the other stats? In the middle, in an order "zombies/shield/health," so that if the shield breaks, the layout doesn't look asymmetrical.

      Just_Lettu 1 Reply Last reply
      1
      • SkyStar300 SkyStar300

        I love it—it's simple and effective. Do you think it would be possible to place the shield health meter next to the other stats? In the middle, in an order "zombies/shield/health," so that if the shield breaks, the layout doesn't look asymmetrical.

        Just_Lettu Offline
        Just_Lettu Offline
        Just_Lettu
        wrote last edited by
        #3

        SkyStar300 Of course. Just to clarify, the zombie counter and health mod isn't mine, i forgot to disable it when taking the screenshots.
        But yes, I can place the shield value and the label at the bottom center of the screen.

        1 Reply Last reply
        0
        • GhostRider01250 Offline
          GhostRider01250 Offline
          GhostRider01250
          wrote last edited by
          #4

          Thats nice dude do you think you could make like bo3 that it shows you your shield health in the hud icon itself 🙃

          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
          • Popular
          • Users
          • Donate