Guest User

Untitled

a guest
Sep 6th, 2021
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. -- ////////////////////     Regeneration support for your hud       ////////////////////
  2.  
  3. --  Client lua:
  4.  
  5. net.Receive("regen_hp", function()
  6.     if LocalPlayer():IsValid() then
  7.         LocalPlayer().DHPRegen = net.ReadUInt(8)
  8.     end
  9. end)
  10.  
  11. -- Call it with something like this:
  12.  
  13. local dhpregen = LocalPlayer().DHPRegen or 0
  14.  
  15. print(dhpregen)
  16.  
  17.  
  18.  
  19.  
  20. -- ////////////////////     Regeneration support for your things        ////////////////////
  21.  
  22. --  Don't forget to subscribe to syringes first
  23. --  Server lua:
  24.  
  25. target.DHPRegen = (target.DHPRegen and target.DHPRegen or 0) + 20 -- 20 is regeneration amount
  26. target.LastDHPRegen = CurTime()
  27. DHPRegenList[target] = true
Advertisement
Add Comment
Please, Sign In to add comment