How do i reset the players health everytime he dies?
Im trying to give the player his health back after he dies so its not just slowly regenerating back.I tried it with a StarterCharacterScript but when the player dies then the script is also gone and on the server side i dont know how to do that
Thanks for the help.
Thats the playerscript for the health but its fine like that i think but now i want to set the players health to maxhealth after he respawned.
1 | local Player = game.Players.LocalPlayer |
2 | local Char = script.Parent |
3 | Char.Humanoid.Health = Char.Humanoid.MaxHealth |
6 | Char.Humanoid.MaxHealth = 100 + Player.Data.DefenseP.Value * 5 |
7 | Char.Keybind.Damage.Value = 10 + Player.Data.MeleeP.Value * 2 |
8 | Char.Humanoid.Health = Char.Humanoid.Health + 1 |