RedM documentation

Murphy's Doctor

Configuration

Consumables


This page covers shared/config_consumables.lua and shared/config_consumables_examples.lua: food, drinks, alcohol, tobacco, drugs and remedies that players use from their inventory, their animations, their effects, the drunk system and how to add your own items.

How it works

Every entry of Config.Consumables.Items is registered as a usable item on your framework at startup (REDEM:RP 2023, VORP or RSG-Core). No code is needed: add an entry and restart the resource. An entry whose item does not exist in your inventory is simply ignored (the doc_selftest console command reports how many entries are unknown to your inventory).

When a player uses the item:

  1. Server. The script checks the player has the item, refuses if they are already consuming something, removes the companion item if requiresItem is set, removes the item itself (unless consumed = false) and gives back giveBackItem if set. The inventory closes unless closeInventory = false.
  2. Client. The animation plays. Nearby players see a simplified version of it with the right prop in hand.
  3. Effects. Once the animation ends, the effects apply (hunger, thirst, cores, alcohol, screen effect...). If the animation fails for any reason, the effects still apply: the item is already gone.
  4. Server hooks. Alcohol wears the liver (Alcohol), the item may roll a contamination (Infection) and raise a dependence (Addiction).

Consuming is refused during a coma. Items of category food, drink, alcohol and medicine are automatically poisonable (see Poison): a poisoned stack applies its poison instead of the normal effects.

General settings

Key Default Description
Config.Consumables.ShowNotifs false Shows a "You are eating / drinking / smoking..." notification when a consumption starts. Off by default to avoid notification spam.
Config.Consumables.LoadCraftExamples false true = also registers the example items of shared/config_consumables_examples.lua (about 160 dishes, drinks and remedies). An example never overrides an item already defined in Items.
Config.Consumables.Labels {} Optional text overrides. Empty = the texts of shared/locales/<lang>.lua (consumables.*). Keys: consuming, consumingDrink, consumingSmoking, consumingMedicine, consumingDrug, cannotConsume, itemNotFound, alreadyConsuming, missingRequiredItem, drunkTipsy, drunkDrunk, drunkWasted, drunkSober.

Item entries

Config.Consumables.Items is a table keyed by item name (the name in your inventory database).

Fully annotated example

lua
Config.Consumables.Items["hot_toddy"] = {
label = "Hot Toddy", -- your own reference; the inventory shows the item's own label
category = "alcohol", -- food | drink | alcohol | tobacco | drug | medicine | misc
animation = "whisky", -- key of Config.Consumables.AnimationPresets
-- Metabolism (points out of 100, negative allowed)
hunger = 0,
thirst = 20, -- negative = the item makes you thirsty (salty food)
-- RedM cores (0-100)
healthCore = 10, -- health inner core; NEGATIVE also removes real HP (see below)
staminaCore = 15, -- stamina inner core
healthGoldCore = 0, -- golden "fortified" health core, like a tonic (0-100)
staminaGoldCore = 0, -- golden "fortified" stamina core (0-100)
-- Body temperature, temporary
temperatureEffect = { amount = 0.5, duration = 120 }, -- +0.5 °C for 120 seconds
-- Alcohol
alcohol = 10, -- alcohol units added to the drunk level
intoxRisk = 0.10, -- 10% chance of acute alcohol intoxication...
-- alwaysIntox = true, -- ...even when sober (rubbing alcohol, vinegar)
-- Temporary effects
screenEffect = { name = "PlayerDrunk01", duration = 60 }, -- seconds
movementClipset = { name = "MP_Style_drunk", duration = 60 }, -- seconds
-- Inventory behaviour
consumed = true, -- false = the item stays in the inventory (accessories)
closeInventory = true, -- false = the inventory stays open on use
giveBackItem = "emptymug", -- item given back after use (empty bottle, mug...)
giveBackAmount = 1,
-- requiresItem = "cigarettes", -- companion item, removed on each use
-- requiresItemAmount = 1,
-- requiresItemLabel = "You need a cigarette.",
-- poison = "poison_mortel", -- apply a poison from Config.Poison.PoisonItems
}

Field reference

Field Type Default Description
label string - Readable name for your own reference. The name shown in the inventory comes from your framework item definition.
category string "food" food, drink, alcohol, tobacco, drug, medicine or misc. Picks the start notification, the fallback animation seen by other players, the dependence substance (Addiction) and whether the item is auto-poisonable (food, drink, alcohol, medicine).
animation string - Key of Config.Consumables.AnimationPresets. Without an animation the effects apply at once.
animationOverride table - A full legacy animation (dict, anim, duration, flag, props) used instead of a preset. See below.
prop string - Replaces the first prop of a legacy (dict/anim) preset and the prop other players see in your hand. The rich animFn animations keep their own props.
hunger number - Hunger points added (out of 100). Negative lowers hunger.
thirst number - Thirst points added. Negative lowers thirst. Has no effect while a disease locks thirst at 0.
healthCore number - Health core points added (0-100). A negative value lowers the core and also removes the same percentage of the max health from the health bar (never below 1 HP).
staminaCore number - Stamina core points added (0-100). Negative lowers it.
healthGoldCore number - Fortifies the health core (gold ring, like a tonic in the base game), 0-100. The game handles the duration.
staminaGoldCore number - Same, for the stamina core.
temperatureEffect table - { amount = °C, duration = seconds }. Shifts the body temperature by amount, then removes the same amount after duration. Clamped to 30-42 °C.
alcohol number - Alcohol units added to the drunk level (see Drunk system). Every unit also wears the liver on the server (Alcohol).
intoxRisk number - Chance (0-1) of acute alcohol intoxication, rolled at consumption only when the drunk level is already at least Config.Alcohol.Intox.MinAlcoholLevel.
alwaysIntox boolean false true = intoxRisk is rolled even when the player is sober. For things that are dangerous to drink at all.
screenEffect table - { name = "<animpostfx>", duration = seconds }. A screen effect played for the duration.
movementClipset table - { name = "<locomotion style>", duration = seconds }. A walk style applied for the duration, then reset.
poison string - Key of Config.Poison.PoisonItems. The item always applies that poison (with that poison's effectDelay).
consumed boolean true false = the item is not removed (fans, pocket watches, cigarette holder).
closeInventory boolean true false = the inventory stays open when the item is used.
giveBackItem string - Item given to the player after use.
giveBackAmount number 1 Quantity of giveBackItem.
requiresItem string - Companion item that must be in the inventory. One unit (or requiresItemAmount) is removed on every use. Without it, the use is refused.
requiresItemAmount number 1 Quantity of requiresItem removed per use.
requiresItemLabel string - Text of the refusal notification. Default: Labels.missingRequiredItem, then the locale.

Adding an item

A food item:

lua
Config.Consumables.Items["apple"] = { label = "Apple", category = "food", animation = "eat", hunger = 8, thirst = 3 }

A drink that gives back the empty bottle:

lua
Config.Consumables.Items["milk"] = {
label = "Milk", category = "drink", animation = "drink", thirst = 35, hunger = 5,
giveBackItem = "emptybottle",
}

A remedy that restores health and fortifies the health core:

lua
Config.Consumables.Items["health_tonic"] = {
label = "Health Tonic", category = "medicine", animation = "drink",
healthCore = 40, healthGoldCore = 50,
}

Then create the item in your inventory (database or item list of your framework) with the same name, and restart murphy_doctor.

Medications that doctors prescribe in the treatment screen are configured in Treatment. An item listed both there and here can also be used directly by players from their inventory.

Animation presets

Config.Consumables.AnimationPresets maps a preset name (used in the animation field) to an animation. A preset can use one of three forms, checked in this order:

Field Description
animFn Name of a built-in rich animation (props, stances, prompts). Recommended.
animFnArgs Optional list of arguments passed to the animFn animation.
interaction Legacy: a native item interaction { itemHash, interactionHash, props = { { model, boneHashName } }, duration, postNative = { native, args } }.
dict, anim, duration, flag, props Legacy: a plain animation. duration in ms (default 5000), flag default 31, props = list of { model, bone, offset = {x,y,z}, rotation = {x,y,z} }.

Shipped presets:

Preset Animation Notes
eat, chew Bite of food -
stew Bowl and spoon -
drink Drink from a bottle -
coffee Mug of coffee -
beer, whisky, wine, rum, gin, cognac, moonshine, champagne Drink the matching bottle or glass -
smoke_cigar Cigar Interactive: puff, change stance, stop.
smoke_cigarette Cigarette Interactive.
smoke_cigarette_holder Cigarette holder Interactive, male and female variants.
smoke_pipe Pipe Interactive.
smoke_pipe_heal Pipe Each puff restores 10 health core points.
smoke_pipe_heal_less Pipe Each puff restores 5 health core points.
calumet Peace pipe -
chewing_tobacco, chewing_tobacco_buffed Chewing tobacco Interactive, two stances.
syringe Quick injection -
bandage Crouch and tend a wound About 10 seconds.
fan Fan yourself Interactive.
pomade Hair pomade -
watch1 to watch9 Check a pocket watch Nine different watch props.

The interactive animations last until the player chooses to stop (prompt on screen), and the effects apply when they stop.

lua
-- a legacy preset with your own animation and prop
Config.Consumables.AnimationPresets.canteen = {
dict = "amb_rest_drunk@world_human_drinking@male_a@idle_a", anim = "idle_a",
duration = 4000, flag = 31,
props = { { model = "p_canteen01x", bone = 0x6F06, offset = { 0.05, -0.07, -0.05 }, rotation = { -75.0, 60.0, 0.0 } } },
}

Drunk system

Every item with alcohol adds its units to the player's drunk level (client side, not saved: a reconnect sobers the player up). The level drops over time and the effects change at each threshold.

Key Default Description
Config.Consumables.Drunk.DecayRate 2.0 Alcohol units removed per decay step.
Config.Consumables.Drunk.DecayInterval 30 Seconds between two decay steps. At the defaults, 10 units take 2.5 minutes to wear off.
Config.Consumables.Drunk.Thresholds.tipsy 20 Drunk level at which the "tipsy" stage starts.
Config.Consumables.Drunk.Thresholds.drunk 50 "Drunk" stage. Keep it equal to Config.Alcohol.Intox.MinAlcoholLevel.
Config.Consumables.Drunk.Thresholds.wasted 80 "Wasted" stage.

Per stage, under Config.Consumables.Drunk.Effects.<tipsy|drunk|wasted>. The random rolls are made on every decay step.

Field tipsy drunk wasted Description
screenEffect nil "PlayerDrunk01" "PlayerDrunk01" Screen effect kept on during the stage.
movementClipset nil "MP_Style_drunk" "MP_Style_drunk" Walk style during the stage. Takes priority over the hypothermia walk.
cameraShake HAND_SHAKE, 0.15 HAND_SHAKE, 0.4 HAND_SHAKE, 0.8 { name, amplitude } camera shake. Amplitude 0 = none.
ragdollChance 0.0 0.05 0.15 Chance (0-1) to fall over on each decay step.
vomitChance 0.0 0.02 0.08 Chance (0-1) to play a vomit animation on each decay step.

The stage is re-evaluated on every decay step, so the effects of a drink show up within DecayInterval seconds. The player is notified when they become tipsy, drunk or wasted, and when they are sober again.

Shipped items

The file ships a working example table mapped to the item names of a French-speaking roleplay server. Keep the entries you want, rename them to your own item names and delete the rest.

Item Category Preset Effects
calumet tobacco calumet stamina core +20, screen effect 120 s
tabacchiquer, tabacchiquermenthe tobacco chewing_tobacco stamina core +20
cigar tobacco smoke_cigar stamina core +20
cigarettes, cigarettesdesert, cigarettementhol tobacco smoke_cigarette stamina core +20
portecigarette tobacco smoke_cigarette_holder reusable, burns one cigarettes per use
laudanum drug moonshine thirst +100
water drink drink thirst +25
bread, pain food eat hunger +12 / +10
lemonade drink drink thirst +40
coffee, thementhe drink coffee thirst +30 / +40, stamina core +30
viandepetitmamiferecuite, viandecuite, viandegibiercuite, viandevolaillecuite, viandereptilecuite, filetpoissoncuit food eat hunger +10 to +20
soupe, ragoutgibier, ragoutviande, ragoutpoisson, ragoutvolaille food stew hunger +40, thirst +20 to +30
cigaretteopium, cigarettechanvre drug smoke_cigarette stamina core +50, screen effect 120 s
pipeopium drug smoke_pipe stamina core +30, screen effect 120 s
morphine medicine syringe stamina core +30, health core +10, screen effect 300 s
heroine drug syringe thirst +100, stamina core +100, health core +30, screen effect 300 s
laitpavot drink drink thirst +40, stamina core +40, health core +15, screen effect 300 s
fan misc fan reusable
watch1 to watch9 misc watch1 to watch9 reusable

Optional craft examples

With LoadCraftExamples = true, shared/config_consumables_examples.lua adds these items (tiered dishes and drinks of a crafting economy). They only work once you create the items in your inventory.

Group Items
Traditional and pastry dishes ragoutvenaisonherbes, saucissepetitgibier, confiture, soupechampignon, jerkyboeuf, painfromageviande, muffinsmures, painmais, delicevanille, puddingvanille
Bayou poeleebayou, soupetortue, ragoutmarecage, soupecajun, gumboalligator, ragoutalligator
Tex-Mex chilivenaison, haricotscowboy, steakcowboy, steakmais, volailleherbes, maisgrille
Trapper poteevenaison, ragoutbonneviande, echinechasseur, pateours, tourteviandechampi, pemmicantrappeur
Berries and milk cassis, framboise, groseilledoree, mure, myrtille, baiedegaultherie, bouteillelait
Concoctions concoctionendurance, concoctionanesthesiante, concoctioncoagulation, concoctiontonic
Cook (tiers 1.5 to 7) soupefortune, ragoutfortune, petitpaincampagne, viandeboucanee, poissonfume, galettemais, biscuitssables, tourtefermiere, tartevanille, bonbonsherbes, bonbonsfruits, etouffeebayou, boudincajun, ragoutherbes, sucettesgourmandes, cookiesfourres, festintrappeur, jambalayaroyal, pralinesmaison, chocolatartisanal, morcnougat, consommeclarifie, tournedosbison, civetsanglier, cassoulet, supremegibier, wellingtongibier, parisbrest, gateauforetnoire, banquetpionnier, festincajun, symphonieterres, trilogiechef, opera, piecemontee, fricasseepoisson, matelotepionnier, ragoutmouton, poissoncroute, cotelettesberger, courtbouilloncajun, chaudreepoisson, taginepionnier, rillettestrappeur, gigotbraise, filetpoissonbaies
Soft drinks cafeglace, jusdebaies, shrubcassis
Alcohol moonshine, gnole, vinaigre, alcoolfriction, bittermedicinal, vinrhubarbe, vinbaiesbois, cidre, vincassis, hydromel, vinfleurs, vingroseille, vinvanille, champagnesauvage, vinepee, hydromelroyal, vinchampagneranch, biereorge, bierebleruste, bieremais, biereherbes, portertrappeur, bieremaisdore, stoutbayous, biereginseng, bierebaies, barleywinebayou, breforge, bockranch, eaudevieprunus, good_whisky, rhum, bourbonranch, gin, alcoolabsinthe, liqueurbaies, liqueurvanille, cremementhe, whiskyvieilli, liqueurginseng, treflenoirforet, vinpeche, nectarbayous, cruvieuxranch, elixirfloral, bocknoire, aletrappeur, grandcruprairie, legendehoublonnee, cognacbayou, absinthecristalline, armagnac, eaudeviemaitre
Herbalist and remedies cataplasmefrais, pavotmache, pavotseche, tabacsec, infusioncalmante, charbonvegetal, tisanesimple, poisonparalysant, baumeclassique, vomitif, camphreartisanal, poisonhalluci, baumecamomille, codeine, poisonsomnifere, digitaline, solutioncreosote, quinine, aspirin, poisonletal, concentrestimulant, antivenin

Several example drinks show the advanced fields: gnole, eaudevieprunus, good_whisky, bourbonranch, alcoolabsinthe and absinthecristalline use intoxRisk; vinaigre and alcoolfriction use alwaysIntox; vingroseille, bocknoire, grandcruprairie, cognacbayou and armagnac have a negative healthCore.

Related: Metabolism · Alcohol · Addiction · Poison · Infection · Items · Animations


Last updated: November 20, 2026