Need help with default death

I’ve been searching for a while and I’ve also been exploring on my own, but I can’t seem to find out how to make a custom death.

I want it so when the player hits 0 health they will “pass out” but is still not dead and can be resurrected or finished.

1 Like

You’d have to make your own health bar value and your own death system probably using ragdoll.

1 Like

yes make your own health bar

how i did this was i set the players health to like a million 100 and when it hit 1 million or less i played a death animation (player falling over) or like xenonix said ragdoll

you could also just make a seperate integer value to keep track of players healths and manage it that way

however one thing id strongly advise is when making these scripts people often forget to reinitialize them once a player has actually died from perhaps falling off the map or reseting

1 Like

Alright, thank you. I’ll try to make my own health bar/system.

Whenever you want to damage the player/humanoid, you could also wrap the TakeDamage function checking if the damage will do more than the player’s health.

Here is a brief explanation:


function TakeDamage(humanoid, damage) -- the function needs a humanoid and a damage value as its parameter
if damage > humanoid.Health then -- checks if damage is greater than humanoid's current health
 --death handler
else -- if not, damage the humanoid as normal
  humanoid:TakeDamage(damage)
end
end
1 Like

This would essentially be the way to go, you’d knock the humanoid’s “Health”, “WalkSpeed”, “JumpPower” & “JumpHeight” properties to 0 and then disable any present health regeneration and ragdoll the character model in a way such that it represents a “passed out” player.

1 Like