How do I make it so the player doesn't die and respawn when he haves 0 health?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want the player to not die or respawn when he haves 0 health

  1. What is the issue? Include screenshots / videos if possible!

I don’t know how

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

search

local function MakeInvincible(humanoid)
   humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead,false)
   humanoid.BreakJointsOnDeath = false
   humanoid.HealthChanged:Connnect(function() humanoid.Health = humanoid.MaxHealth end)
end

Didn’t work the player can’t walk and I don’t want to change the player health I want to make it so the player can walk and not respawn even if he has 0 health

it should be server sided, and i dont think you can have 0 health

I saw a post that had the script that doesn’t make you respawn and makes you able to walk when you have 0 health but I can’t find the post

And Yes it is server sided

if you reseted on the client, it wouldnt work. Client humanoid states act different

No I didn’t reset I used a part that when touched it damages you

Fixed it

local function MakeInvincible(humanoid : Humanoid)
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead,false)
	humanoid.BreakJointsOnDeath = false
	humanoid.HealthChanged:Connect(function(hea) 
		task.wait()
		humanoid.Health = 0.1
		humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
	end)
end

1 Like

Thank you so much for helping me

1 Like