As many games such as rogue lineage and mighty omega have done, instead of dying when the player’s health hits 0, they get knocked out and can then be executed. I’m trying to make this.
I’ve already seen many threads about knockout systems and such but all of them say to set humanoid state ‘dead’ to false.
While this does somewhat work, the player still respawns after a few seconds of being knocked out.
here’s my code:
--local script
local knocked = false
hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
hum.HealthChanged:Connect(function()
if hum.Health <= 0 then
if not knocked then
knocked = true
RS.Misc.Knocked:FireServer()
kneel:Play() --animation
kneeling:Play() --animation
end
end
end)
another solution i saw was to make a custom health system but i’ve seen games use roblox health and still accomplish the same thing so i was trying to be more optimized.