Consumables
Food, drinks, smokes and medicine live in shared/consumables.lua. Each item plays an animation with a prop, shows a progress bar, and applies its effects when finished. Getting knocked down or jumping in water cancels it, and the item is kept.
๐ Item fields
| Field | What it does |
|---|---|
label | Name on the progress bar |
anim | One of the animations in Consumables.Animations |
hunger, thirst, stress, cleanliness, fatigue, alcohol, drug, sickness | Added to the need. Use negative numbers to take away |
health, stamina | Refills the core and heals or restores stamina |
gold | { health = 120 } or { stamina = 120 } makes the core gold for that many seconds |
warmth | { amount = 5, duration = 180 } warms the player for a while |
effect | { id = 'focus', label = 'Focused', icon = 'eye', duration = 300 } adds an effect chip |
duration | Overrides the animation length in milliseconds |
coffee = { label = 'Coffee', anim = 'coffee', thirst = 12, alcohol = -30, stamina = 15, warmth = { amount = 5, duration = 180 } },โญ Quality and ingredients
Item metadata changes the result:
quality(0 to 100) scales the good parts. A 50% quality stew fills half as much.effectsadds to or replaces fields, so a cooked meal can carry what went into it.
{ quality = 80, effects = { hunger = 10, warmth = { amount = 8, duration = 300 } } }๐ฌ Animations
Animations are either anim (dictionary, name, prop, bone and offset) or scenario. Add your own to Consumables.Animations and point items at them.
๐ Other inventories
Items are registered automatically on RSG and VORP. For any other inventory, call the client export when the item is used and remove the item yourself:
exports['kartik-hud']:Consume('bread', { quality = 90 })Set Consumables.RegisterItems = false if another script already handles these items.