Advertisement
Sungmingamerpro13

Regeneration Gamepass(STORY GAME)

Sep 5th, 2022
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. local GamepassId = 81050086
  2.  
  3. local Regen_rate = 5/100
  4. local Regen_rate2 = 5/150
  5. local Regen_Step = 5
  6.  
  7. game.Players.PlayerAdded:Connect(function(player)
  8. if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, GamepassId) then
  9. player.CharacterAdded:Connect(function(char)
  10. while true do
  11. if char.Humanoid.Health > char.Humanoid.MaxHealth then
  12. local DT = wait(Regen_Step)
  13. local DH = DT*Regen_rate*char.Humanoid.Health
  14. char.Humanoid.Health = math.min(char.Humanoid.Health + DH, char.Humanoid.Health)
  15. else
  16. local DT = wait(Regen_rate2)
  17. local DH = DT*Regen_rate2*char.Humanoid.Health
  18. char.Humanoid.Health = math.min(char.Humanoid.Health + DH, char.Humanoid.Health)
  19. end
  20. end
  21. end)
  22. end
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement