Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Default health not regenerating?

Asked by 5 years ago

So I gave up on the custom health gui and just decided to stick with the default one roblox gives you and whenever I play in studio it gives my character a script called "Health" which contains this

01-- Gradually regenerates the Humanoid's Health over time.
02 
03local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
04local REGEN_STEP = 1 -- Wait this long between each regeneration step.
05 
06--------------------------------------------------------------------------------
07 
08local Character = script.Parent
09local Humanoid = Character:WaitForChild'Humanoid'
10 
11--------------------------------------------------------------------------------
12 
13while true do
14    while Humanoid.Health < Humanoid.MaxHealth do
15        local dt = wait(REGEN_STEP)
16        local dh = dt*REGEN_RATE*Humanoid.MaxHealth
17        Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
18    end
19    Humanoid.HealthChanged:Wait()
20end

I have made no changes to this yet the health still wont regenerate when I get hurt i've been trying to fix this for hours help

0
line 08, local Character = game.Players.LocalPlayer.Character Spiritlotus 151 — 5y
0
I typed that in on line 8 and nothing changed it still wont regen THEGOBLINTOPLAD 0 — 5y

Answer this question