I have a script that sets a players Max Heatlh but I need help creating a script that sets the players Health
Here is My Max Health Script
wait() local character = game.Workspace:FindFirstChild(script.Parent.Parent.Name) if script.Parent.Parent:FindFirstChild("Values") == nil then value = Instance.new("NumberValue") value.Name = "Values" maxhealth = Instance.new("NumberValue") maxhealth.Name = "MaxHealth" maxhealth.Parent = value maxhealth.Value = 250 value.Parent = script.Parent.Parent end addscript = script.SetMaxHealth:Clone() addscript.Parent = character addscript.Disabled = false
Second Script
h = script.Parent.Humanoid while true do h.MaxHealth = game.Players:FindFirstChild(h.Parent.Name).Values.MaxHealth.Value wait(2) end
Probably should go watch some tutorials and get some understanding of how programming/scripting works in roblox before frankensteining scripts.
--LocalScript local ply = game.Players.LocalPlayer --This is the player which has the gui, backpack, etc local val = 200 --Value we want for the player's maxhealth ply.CharacterAdded:connect(function(cha) --Connecting event to function to get the player character local hum = cha:WaitForChild("Humanoid") --Waiting for character's humanoid child hum.MaxHealth = val --Humanoid's MaxHealth and Health properties aren't objects, but number's so you don't use Value for them hum.Health = val end)