Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ITEM = {}
- ITEM.NAME = "Fritos chips"
- ITEM.INFORMATION = "Smager godt."
- ITEM.MODEL = "models/foodnhouseholditems/chipsfritos.mdl"
- ITEM.SKIN = 0
- ITEM.SELL = 25
- ITEM.BUY = 50
- ITEM.WEIGHT = 1
- ITEM.USE = function(self, ply)
- --CODE SNIPPED FOR ADDING HUNGER + HEALTH
- local health, hunger = 5, 35
- if (DarkRP) then
- for k, v in pairs(DarkRP.disabledDefaults["modules"]) do
- if(k == "hungermod" and v == false) then
- ply:setSelfDarkRPVar("Energy", math.Clamp((ply:getDarkRPVar("Energy") or 100) + hunger, 0, 100))
- end
- end
- end
- if (ply:Health() <= 100) then
- ply:SetHealth(ply:Health() + health)
- if (ply:Health() >= 100) then
- ply:SetHealth(100)
- end
- end
- end
- CRAFTINGMOD.ITEMS:Register(ITEM)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement