function regenHealth()if Regening then return end Regening=true while Humanoid.Health<Humanoid.MaxHealth do local B=wait(1)local i=Humanoid.Health if i>0 and i<Humanoid.MaxHealth then local e=(.01*B)*Humanoid.MaxHealth i=i+e Humanoid.Health=math.min(i,Humanoid.MaxHealth)end end if Humanoid.Health>Humanoid.MaxHealth then Humanoid.Health=Humanoid.MaxHealth end Regening=false end Humanoid.HealthChanged:connect(regenHealth)
-- Regeneration
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)
