I’m sorry for the title, but I don’t know how to explain this.
When the player’s health =< 0 i would like to set his health to 15, but if I use this code:
function healthexample() local ply = LocalPlayer() local playerhealth = ply:Health() timer.Create( "healthtimer", 1, 0, function() if playerhealth <= 0 then hook.Call( "dontdie" ) end end ) end function sethealth() ply:SetHealth( 15 ) end hook.Add( "dontdie", "health example", sethealth)
Don’t works, because the player dies.
How can I do this?