I think the error is because I'm doing something to many times, the error on line 9
local MaxHealth = 120
game.Workspace.ChildAdded:connect(function(Child)
local Humanoid = Child:FindFirstChild("Humanoid")
local Player = game.Players:FindFirstChild(Child.Name)
if Humanoid then
Humanoid.Changed:connect(function()
if Player and Humanoid.MaxHealth == math.huge then
Humanoid.MaxHealth = 100
elseif Player and Humanoid.MaxHealth > MaxHealth then
Humanoid.MaxHealth = 100
elseif Player and Humanoid.MaxHealth == 0 and Humanoid.Health > 0 then
Humanoid.MaxHealth = 100
elseif Player and Humanoid.Health > MaxHealth then
Humanoid.Health = 100
end
end)
end
end)

2 comments
The Errors went away but it did not work
Your code may have more than one mistake, then.