Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i reset the players health everytime he dies?

Asked by 4 years ago

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
0
Use the PlayerAdded event of the Players Service then CharacterAdded event of the player then the Died event of the Character's Humanoid SerpentineKing 3885 — 4y
0
I tryed that ,could you show the scirpt to it? valledestroy 54 — 4y

Answer this question