Kartik Scripts

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

FieldWhat it does
labelName on the progress bar
animOne of the animations in Consumables.Animations
hunger, thirst, stress, cleanliness, fatigue, alcohol, drug, sicknessAdded to the need. Use negative numbers to take away
health, staminaRefills 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
durationOverrides 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.
  • effects adds 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.

On this page