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.
local Player = game.Players.LocalPlayer local Char = script.Parent Char.Humanoid.Health = Char.Humanoid.MaxHealth while wait() do wait(.5) Char.Humanoid.MaxHealth = 100 + Player.Data.DefenseP.Value * 5 Char.Keybind.Damage.Value = 10 + Player.Data.MeleeP.Value * 2 Char.Humanoid.Health = Char.Humanoid.Health + 1 end