Is there a way to detect lethal blows on humanoids (and prevent the humanoid from dying)

im trying to make a cool seamless phase 2 to a boss that requires you to fully empty its health-bar before it does a cool cutscene and actually phase 2s

only issue is: i have LITERALLY no idea how to detect a lethal blow and stop it from well, being lethal, because if you empty a health bar; well, the health is empty, which means the boss DIES

Maybe make the boss’ health very low when 0

local connection = {}
connection[1] = Boss.Humanoid.HealthChanged:Connect(function(health: number)
    if health <= 0 then
        Boss.Humanoid.Health = 0.0001 -- or some number
        -- do cutscene


        connection[1]:Disconnect()
    end
end)

wouldnt when the boss’ health being 0 just immediately kill it, regardless of what scripts detecting it set the health back to

If you want to prevent an npc from dying, I’m pretty sure disabling it’s dead state should work.

Something like:

Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false)

In addition to this, you probably won’t need to detect a lethal blow, since you can just re enable the dead state after the phase 2 transition.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.