--Humanoid Death Disabled--
local died = false
if health <= 0 then
if not died then
died = true
died = false
I am aware that the top method does not work to make the player whose health is at 0 (dead) come back on his feet after 20 seconds. It will just continue being in a platformstanding state. My question is, how would you make it so after 20 seconds, humanoid is back on its feet?
I remember the idle movement state being RunningNoPhysics, so it’d probably be more appropriate to use that instead to force the Humanoid to an idle state. Running is for active Humanoids performing physics calculations.
Could you show what you’re currently working with, or has it not changed since you posted it in the OP?
Frankly, anything to do with Humanoids is super hacky, espcially trying to force the death state off. I feel like you’d have more luck using a lower-level hack such as forcing the Humanoid health to be above 0.01 and treating any health below 1 as a pseudodeath state.
In Rogue Lineage, the character doesn’t actually die, because the health bar is still slightly above 0. I would just do what @colbert2677 described, and just set their health very close to 0 instead. You can just fork the Health script from your in-game character, and make the health bar stop regenerating for a short time before regenerating again if their health is below a threshold.
For example, this would be the default Health script:
local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = 1 -- Wait this long between each regeneration step.
local Character = script.Parent
local Humanoid = Character:WaitForChild'Humanoid'
while true do
while Humanoid.Health < Humanoid.MaxHealth do
local dt = wait(REGEN_STEP)
local dh = dt*REGEN_RATE*Humanoid.MaxHealth
Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
You can insert an if statement before running the while loop to see if you should make the character stop regenerating. Spoiler, this is pseudocode:
while true do
if Humanoid.Health < 1 then -- or something
Humanoid.Health = Humanoid.Health + 1
-- run the usual while loop
-- health changed wait
You also do need to force clamp the Health. Stopping regeneration at a certain point isn’t enough because if the Humanoid takes a large enough damage value, they will die. Keeping it in the while loop will cause this to happen: setting it immediately upon a registered health change will not.