Mryeetmemes

another roblox script inside of you when you join, and its the health script

Apr 21st, 2023
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. -- Gradually regenerates the Humanoid's Health over time.
  2.  
  3. local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
  4. local REGEN_STEP = 1 -- Wait this long between each regeneration step.
  5.  
  6. --------------------------------------------------------------------------------
  7.  
  8. local Character = script.Parent
  9. local Humanoid = Character:WaitForChild'Humanoid'
  10.  
  11. --------------------------------------------------------------------------------
  12.  
  13. while 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()
  20. end
Add Comment
Please, Sign In to add comment