SHARE
TWEET

Untitled

a guest Oct 19th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local ITEM = {}
  2.  
  3. ITEM.NAME = "Doritos chips"
  4. ITEM.INFORMATION = "Kims er bedre."
  5. ITEM.MODEL = "models/foodnhouseholditems/chipsdoritos.mdl"
  6. ITEM.SKIN = 0
  7.  
  8. ITEM.SELL = 25
  9. ITEM.BUY = 50
  10.  
  11. ITEM.WEIGHT = 1
  12.  
  13. ITEM.USE = function(self, ply)
  14.     --CODE SNIPPED FOR ADDING HUNGER + HEALTH
  15.  
  16.     local health, hunger = 5, 35
  17.    
  18.     if (DarkRP) then
  19.         for k, v in pairs(DarkRP.disabledDefaults["modules"]) do
  20.             if(k == "hungermod" and v == false) then
  21.                 ply:setSelfDarkRPVar("Energy", math.Clamp((ply:getDarkRPVar("Energy") or 100) + hunger, 0, 100))
  22.             end
  23.         end
  24.     end
  25.     if (ply:Health() <= 100) then
  26.         ply:SetHealth(ply:Health() + health)
  27.         if (ply:Health() >= 100) then
  28.             ply:SetHealth(100)
  29.         end
  30.     end
  31. end
  32.  
  33. CRAFTINGMOD.ITEMS:Register(ITEM)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top