The goal is to have a script that keeps you from doing the classic roblox OOF that reloads your character. The rest is handled by another script, but it would seem that if something does enough damage you will fully die anyway, why is this?
repeat wait(2) until game.Loaded
game.Players.PlayerAdded:Connect(function(Player)
local Char = workspace:FindFirstChild(Player.Name)
while true do
wait()
Char.Humanoid.HealthChanged:Connect(function()
if Char.Humanoid.Health <= 2 then
Char.Humanoid.Health = Char.Humanoid.MaxHealth
end
end)
end
end)

5 comments
Try out Player:LoadCharacter
That is the opposite of what I am trying to do, reloading the character is what I am trying to avoid.
So do you want to die at all in the game? or not
Not quite, I have a custom death, where it replaces your health and teleports you. Mainly because death breaks a script that is important, so I have to keep the character at the first joined state.
so do you have a custom health?