Further enhance and add in an advanced prevent character/humanoid from removal. And  also add in an advanced health layering.

```
print("loading...")
loadstring(game:HttpGet('https://raw.githubusercontent.com/Lucasfin000/SpaceHub/main/UESP'))()

local targetPlayerName = "plshelpme8312"
local invincibleHealth = 1e9 -- A very high health value to simulate invincibility
local invincibilityFrameDuration = 5 -- Duration in seconds for invincibility frames

-- Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

-- Table to store original Humanoid methods and properties
local originalHumanoid = {}

-- Function to create a Humanoid Stabilizer using metatables
local function createHumanoidStabilizer(humanoid)
    if humanoid:GetAttribute("StabilizerActive") then
        return -- Prevent re-initialization
    end
    humanoid:SetAttribute("StabilizerActive", true)

    -- Store original Humanoid methods and properties
    originalHumanoid[humanoid] = {
        Health = humanoid.Health,
        MaxHealth = humanoid.MaxHealth,
        TakeDamage = humanoid.TakeDamage,
        -- Add other methods/properties if needed
    }

    -- Metatable for the Humanoid
    local humanoidProxy = {}
    humanoidProxy.__index = humanoid

    setmetatable(humanoid, {
        __index = function(tbl, key)
            -- Allow access to existing properties and methods
            return humanoidProxy[key] or humanoid[key]
        end,
        __newindex = function(tbl, key, value)
            if key == "Health" or key == "MaxHealth" then
                -- Prevent modification of Health and MaxHealth
                print("Attempt to modify " .. key .. " was blocked.")
            else
                humanoid[key] = value -- Allow other properties to be set normally
            end
        end,
        __metatable = "Humanoid is locked down."
    })

    -- Override the TakeDamage method to prevent health reduction
    humanoid.TakeDamage = function(_, damage)
        print("TakeDamage called but blocked to maintain invincibility.")
        -- Optionally, you can log or handle damage attempts here
    end

    -- Implement Invincibility Frames
    local isInvincible = false
    local function activateInvincibilityFrame()
        if isInvincible then return end
        isInvincible = true
        print("Invincibility Frame Activated for " .. humanoid.Parent.Name)

        -- Restore Health periodically during invincibility
        local invincibilityLoop
        invincibilityLoop = RunService.Heartbeat:Connect(function()
            if humanoid.Health < invincibleHealth then
                humanoid.Health = invincibleHealth
            end
        end)

        -- Deactivate Invincibility Frame after duration
        delay(invincibilityFrameDuration, function()
            isInvincible = false
            print("Invincibility Frame Deactivated for " .. humanoid.Parent.Name)
            invincibilityLoop:Disconnect()
        end)
    end

    -- Listen to any events that might inflict damage and activate invincibility frames
    humanoid:GetPropertyChangedSignal("Health"):Connect(function()
        if humanoid.Health < invincibleHealth and not isInvincible then
            activateInvincibilityFrame()
        end
    end)
end

-- Function to nod (set up multiple protections) the humanoid with stabilizer
local function nodHumanoid(character)
    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if humanoid then
        -- Set initial high health and MaxHealth
        humanoid.MaxHealth = invincibleHealth
        humanoid.Health = invincibleHealth

        -- Enforce invincibility preemptively
        RunService:BindToRenderStep("InvincibilityEnforcer_" .. humanoid:GetFullName(), Enum.RenderPriority.PreUpdate, function()
            if humanoid and humanoid.Health < invincibleHealth then
                humanoid.Health = invincibleHealth
            end
        end)

        -- Monitor health changes with advanced buffer
        local debounce = false
        humanoid:GetPropertyChangedSignal("Health"):Connect(function()
            if not debounce then
                debounce = true
                RunService.Heartbeat:Wait()
                if humanoid.Health < invincibleHealth then
                    humanoid.Health = invincibleHealth
                end
                debounce = false
            end
        end)

        -- Apply Humanoid Stabilizer
        createHumanoidStabilizer(humanoid)

        -- Additional protection: Disable health regeneration if necessary
        humanoid:SetAttribute("Invincible", true)

        -- Optionally, remove any existing damage sources or overriding scripts
        for _, script in ipairs(character:GetDescendants()) do
            if script:IsA("Script") or script:IsA("LocalScript") then
                script:Destroy()
            end
        end

        -- Reference Character Parts for Stabilization
        local t = character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso")
        local h = character:FindFirstChild("Head")
        local ra = character:FindFirstChild("Right Arm") or character:FindFirstChild("RightHand")
        local la = character:FindFirstChild("Left Arm") or character:FindFirstChild("LeftHand")
        local rl = character:FindFirstChild("Right Leg") or character:FindFirstChild("RightFoot")
        local ll = character:FindFirstChild("Left Leg") or character:FindFirstChild("LeftFoot")
        local tors = character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso")
        local lleg = character:FindFirstChild("Left Leg") or character:FindFirstChild("LeftFoot")
        local root = character:FindFirstChild("HumanoidRootPart")
        local hed = character:FindFirstChild("Head")
        local rleg = character:FindFirstChild("Right Leg") or character:FindFirstChild("RightFoot")
        local rarm = character:FindFirstChild("Right Arm") or character:FindFirstChild("RightHand")
        local larm = character:FindFirstChild("Left Arm") or character:FindFirstChild("LeftHand")

        -- Stabilize character parts (example: prevent parts from being moved or destroyed)
        local parts = {t, h, ra, la, rl, ll, tors, lleg, root, hed, rleg, rarm, larm}
        for _, part in ipairs(parts) do
            if part then
                -- Lock the part's CFrame to prevent movement
                RunService.Stepped:Connect(function()
                    if part and humanoid then
                        part.Anchored = false -- Ensure it's not anchored
                        -- Optionally, reset CFrame or other properties if tampered with
                    end
                end)

                -- Protect parts from being destroyed
                part.ChildRemoved:Connect(function(child)
                    if child:IsA("Motor6D") or child:IsA("Accessory") then
                        -- Optionally, handle child removal
                        part:Destroy() -- Or implement custom logic
                        -- Note: Be cautious with part destruction
                    end
                end)
            end
        end
    end
end

-- Function to make a player invulnerable with advanced humanoid controller
local function makeInvulnerable(player)
    if player.Name ~= targetPlayerName then return end

    local function onCharacterAdded(character)
        nodHumanoid(character)
    end

    player.CharacterAdded:Connect(onCharacterAdded)

    -- Apply immediately if the player already has a character
    if player.Character then
        nodHumanoid(player.Character)
    end
end

-- Connect the makeInvulnerable function to current and future players
Players.PlayerAdded:Connect(makeInvulnerable)
for _, player in ipairs(Players:GetPlayers()) do
    makeInvulnerable(player)
end

-- Optional: Prevent the target player from being removed or disconnected
Players.PlayerRemoving:Connect(function(player)
    if player.Name == targetPlayerName then
        -- Re-add the player or handle as needed
        -- Note: Manipulating PlayerRemoving can have unintended consequences
    end
end)