Can the health regen and time be dynamic?
my idea was to add 2 value, 1 is a HealthRegen value, 1 is a HealthTime value, so that i can change the regeneration any time
The problem is that it doesnt work:
`-- Gradually regenerates the Humanoid's Health over time.
local REGEN_RATE = script.RegenAmount.Value -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = script.RegenTime.Value -- Wait this long between each regeneration step.
local Character = script.Parent
local Humanoid = Character:WaitForChild'Humanoid'
while true do
while Humanoid.Health < Humanoid.MaxHealth do
local dt = wait(REGEN_STEP)
local dh = dtREGEN_RATEHumanoid.MaxHealth
Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
end
Humanoid.HealthChanged:Wait()
end`