Dying by taking damage causes the Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead,false) to not work

im trying to make a combat game that contains people with multiple phases, using scripts i want to disable roblox’s humanoid death using

local Humanoid = script.Parent.Parent.Parent.Humanoid Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead,false)

the issue is that the health bar (i disabled it) doesn’t go to 0 using the roblox reset system BUT the script works by making the character respawn (i will disable the reset button soon) but taking damage to hit 0 will make the script work in a certain way, the health bar changes to 0 and the player still is able to move around but the game forces the player to respawn while using reset doesn’t.

all i found was that script and nothing else to be able to help me with this

any help is appreciated