I have been trying to get help over the past few days.. And nothing has worked.
What I have been trying to do is take the leaderstat 'Health' put it to 100 if it's lower then 100. Then, When ever they respawn, change their health and maxhealth to the IntValue of 'Health' in leaderstat.
player>leaderstat>Health
wait(0) plr=game:service("Players").LocalPlayer repeat wait(0)until plr.Character~=nil --I guess you can remove the nil if you want plr2=plr.Character:FindFirstChild("Humanoid") if plr2~=nil then --I guess you can remove the nil if you want plr2.MaxHealth=plr:FindFirstChild("leaderstats").WHATEVERTHENAMEIS.Value plr2.Health=plr2.MaxHealth elseif not plr2~=nil or not plr:FindFirstChild("leaderstats")~=nil or not plr:FindFirstChild("leaderstats"):FindFirstChild("WHATEVERTHENAMEIS")~=nil then print("Humanoid does not exist") end
When the Character is added after the character is removed, set Health and MaxHealth to the value.
edit:
local SetHealth = 120 Players.PlayerAdded:connect(plr plr.CharacterAdded:connection(Character Character.Humanoid.MaxHealth = SetHealth Character.Humanoid.Health = SetHealth end) end)
That might not be perfect, but it should be close.