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

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. [ZM] BO3's Three hit system and increased health for Juggernog as well! v2!

[ZM] BO3's Three hit system and increased health for Juggernog as well! v2!

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
1 Posts 1 Posters 190 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.
  • Coronavirus-19undefined Offline
    Coronavirus-19undefined Offline
    Coronavirus-19
    wrote last edited by Coronavirus-19
    #1

    To add this script first copy n' paste this code into Notepad++ then save it as a ".txt" after edit the change ".txt" to ".gsc" -- if you don't know how to do that open up a random folder look for "View" at the top and click it. A drop down menu should appear and you'll see "Show" at the bottom, click it and you'll see "File name extension" and should be able to change ".txt" to ".gsc"

    --You can name the file whatever you want, just make sure it ends with ".gsc"

    After the File name extension change add the ".gsc" to the Plutonium folders by:
    Win + R and Run "%localappdata%" then search for "Plutonium" and go the folders as shown: Local/Plutonium/storage/t6/scripts/zm

    GSC File Download

    Raw Code:

    #include common_scripts\utility;
    #include maps\mp\_utility;
    
    init()
    {
        level thread onPlayerConnect();
    }
    
    onPlayerConnect()
    {
        for (;;)
        {
            level waittill("connected", player);
            player thread onPlayerSpawned();
        }
    }
    
    onPlayerSpawned()
    {
        self endon("disconnect");
        level endon("game_ended");
    
        for (;;)
        {
            self waittill("spawned_player");
    
            // Initialize state
            self.jugActive = false;
    
            // Apply base health immediately on spawn
            self.maxhealth = 150;
            self.health = self.maxhealth;
            self IPrintLnBold("Base Health set to 150HP");
    
            // Start two threads:
            // 1) continuously watch for hasPerk changes (jug acquired/lost)
            // 2) reapply appropriate health immediately on revive (fixes game resetting to 100)
            self thread monitorPerkChanges();
            self thread handleRevives();
        }
    }
    
    monitorPerkChanges()
    {
        self endon("disconnect");
        level endon("game_ended");
    
        for (;;)
        {
            wait 0.25; // faster reaction, smoother sync
    
            // Check Juggernog perk
            hasJugNow = self hasPerk("specialty_armorvest");
    
            // If perk state changed, update
            if (!isDefined(self.jugActive) || hasJugNow != self.jugActive)
            {
                self.jugActive = hasJugNow;
    
                if (self.jugActive)
                {
                    // Force overwrite game perk health logic
                    wait 0.2; // let perk scripts finish first, then override
                    self.maxhealth = 300;
                    self.health = self.maxhealth;
                    self.healthRegenDelay = 0; // prevents weird recovery interference
                    self IPrintLnBold("Juggernog acquired! Health set to 300HP");
                }
                else
                {
                    // Back to base 150
                    wait 0.2;
                    self.maxhealth = 150;
                    self.health = self.maxhealth;
                    self IPrintLnBold("Juggernog lost or not owned. Health set to 150HP");
                }
            }
        }
    }
    
    handleRevives()
    {
        self endon("disconnect");
        level endon("game_ended");
    
        for (;;)
        {
            // This waits until the player is revived.
            // When revive happens, the game's internal logic can reset health to 100,
            // so it'll immediately reapply our desired maxhealth based on current jugActive.
            self waittill("player_revived");
    
            // After revive, reapply correct health state
            if (isDefined(self.jugActive) && self.jugActive)
            {
                // If jugActive is true (player still has perk after revive):
                // So it'll revert to 150 on revive even if they had jug before going down.
                //
                // If you instead want revive to keep Jug's 300 when they still own Jug after revive,
                // change the following block to set 300 instead of 150.
                self.maxhealth = 150;
                self.health = self.maxhealth;
                self IPrintLnBold("Revived — health set to 150HP (must re-obtain Jug to get 300HP)");
            }
            else
            {
                // No Jug — ensure base 150
                self.maxhealth = 150;
                self.health = self.maxhealth;
                self IPrintLnBold("Revived — health remains 150HP");
            }
    
            // Note: monitorPerkChanges() will immediately detect if the player re-buys Jug after revive
            // and will set the health to 300 when that happens.
        }
    }
    
    
    1 Reply Last reply
    0
    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
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Donate