Prevent character from dying when health hits 0

How can I keep the character in full control of the player when health is at 0?
I am doing this because I use a custom death system which the player has to be executed.

3 Likes

Prevent the player health reaching 0 by not having anything in your game that reduces the health, i.e. disable Roblox’s inbuilt health system and use your own health system and implement the events that happen when it reaches zero.

1 Like

It was a really long time ago, but I did accomplish this some how in a way that didnt require me altering any of the damage dealing systems and instead a script could fully prevent it. Ofc, the game that had this script is in a group that I no longer have access to,

If you do not want to create your own health system, you can just set the player’s health above zero when it hits zero.

humanoid.HealthChanged:Connect(function(health)
    if health == 0 then
        humanoid.Health = 1
    end
end)

If you don’t want this, maybe I can try to find other ways of doing this.

Edit: I tested this. For me, if damage is dealt to me that is higher than my current health, I end up resetting, anyway. So, it’s probably best if you reset the player’s health to his or her MaxHealth instead of 1.

you can make a blank script and name it “Health” and put it starterCharacterScripts, that should overwrite roblox’s health script and allow you to implement anything without restrictions

image
lol this literally works

2 Likes

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