function regenHealth()if Regening then return end Regening=true while Humanoid.Health<Humanoid.MaxHealth do local i=wait(1)local k=Humanoid.Health if k>0 and k<Humanoid.MaxHealth then local b=(.01*i)*Humanoid.MaxHealth k=k+b Humanoid.Health=math.min(k,Humanoid.MaxHealth)end end if Humanoid.Health>Humanoid.MaxHealth then Humanoid.Health=Humanoid.MaxHealth end Regening=false end Humanoid.HealthChanged:connect(regenHealth)

function regenHealth()
	if Regening then return end
	Regening = true
	
	while Humanoid.Health < Humanoid.MaxHealth do
		local waiting = wait(1)
		local health = Humanoid.Health
		if health > 0 and health < Humanoid.MaxHealth then
			local newHealthDelta = 0.01 * waiting * Humanoid.MaxHealth
			health = health + newHealthDelta
			Humanoid.Health = math.min(health,Humanoid.MaxHealth)
		end
	end
	
	if Humanoid.Health > Humanoid.MaxHealth then
		Humanoid.Health = Humanoid.MaxHealth
	end
	
	Regening = false
end

Humanoid.HealthChanged:connect(regenHealth)
  
