RedM documentation
Murphy's Doctor
Developers
Extension points
Every way to plug your own code into murphy_doctor without touching the escrowed server files, from the lightest (a config value) to the heaviest (editing a client file). Each section ends with an example.
| Need | Extension point |
|---|---|
| Your own notification system | Config.NotifyStyle = "custom" + Config.CustomNotify |
| Your own HUD for hunger, thirst, temperature | Config.Metabolism.Enabled = false + client exports |
| Revive or heal from an admin menu | AuthorizeComaExit, murphy_doctor:revivePlayer, AdminHealCharacter |
| Your own death or respawn script | AuthorizeComaExit, CleanupComaState, SetDamageTrackingEnabled |
| A law job reading incidents and certificates | GetIncidents, GetDeathCertificates, events, LawJobs |
| A custom inventory or shop | Server adapter functions, murphy_doctor:useConsumable |
| Job and doctor detection | DoctorDetection, cache invalidation |
| A target or radial menu | Radial client events, non-blocking exports |
| A weather script | murphy_doctor:setWeather |
| A vitals or character creator script | scriptedHealthChange, murphy_doctor:skinTone state bag |
| Diseases and vaccines from your scripts | TryInfect, GrantImmunity |
| Animations and consumables | Config.Animations, Config.Consumables.AnimationPresets, client/consumables_anims.lua |
| Logs | Config.DiscordLogs, the murphy_platform:pushCustomEvent feed |
| Debug tools | Config.Debug, doc_selftest, RunSelfTest, /doc:close |
| Editing client files and adapters | client/, server/adapters/ |
Custom notifications
Config.CustomNotify (in shared/config.lua) is the only function-valued key of the configuration. Set
Config.NotifyStyle = "custom" and every notification of the script, server ones included, goes through it on the
client. If your function errors, the game's own notification is shown instead and the error is printed in F8.
| Argument | Content |
|---|---|
title |
Already translated ("Doctor", "Treasury", "Health"...) |
text |
The message, already translated |
kind |
"info", "success", "warning" or "error" |
duration |
Milliseconds |
icon |
The icon the Murphy box would show ("tick", "cross", "alert", "money", "shield"...) or nil |
zone |
The zone the caller asked for ("feed", "center"...) or nil |
The other styles (murphy, framework, native) need no code; see Notifications. The
framework style calls FrameworkNotifyLeft in the client adapter, which you can also rewrite.
To show a message that looks like the script's own from your resource, call the client export Notify or trigger
murphy_doctor:notify (see Events).
Custom HUD
Config.Metabolism.Enabled only controls the built-in HUD: hunger, thirst, temperature and conditions keep running
when it is false. Turn the HUD off and read the values from your own HUD resource.
The low-hunger, low-thirst, health and temperature warnings keep running while the built-in HUD is off: your HUD only has to display the values.
If you keep the built-in HUD and only need to hide it for a while (cutscene, photo mode), use HideMetabolismHUD and
ShowMetabolismHUD.
Revive and heal from an admin menu
A revive issued by another resource has two halves:
- Server:
AuthorizeComaExit(target), otherwiseConfig.Coma.ServerExitCheckrefuses the early exit and the coma comes back on the next connection. - Client of the target: get out of the coma. The simplest is murphy_doctor's own handler,
murphy_doctor:revivePlayer, which resurrects in place at full health.
The VORP admin revive (vorp_core:Server:OnPlayerRevive) and the RSG admin menu revive
(rsg-adminmenu:server:playerrevive) are already wired in the adapters: nothing to add for them.
Custom death or respawn script
murphy_doctor owns the death flow (coma screen, help call, doctor revive, get up after the timer). Run only one death script. If yours must resurrect the player itself:
Scripts that damage or teleport the player on purpose (a fall in a cutscene, a trap minigame) can pause injury creation:
Law jobs
Doctors, staff and the jobs listed in Config.Incidents.LawJobs can already read the records in game with
/incidents and /certificates (Config.Autopsy.LawJobs defaults to the same list). From a law resource:
GetIncidents needs Config.Incidents.Enabled, GetDeathCertificates needs Config.Autopsy.Enabled (see
Server exports).
Custom inventory or shop
Inventory and money go through the server adapter of your framework (server/adapters/, not escrowed): GiveItem,
RemoveItem, GetItemAmount, GetItemMeta, GetPlayerInventory, FrameworkRegisterUsableItem, money functions.
To use another inventory, rewrite those functions; the contract is in Framework adapters.
To make a shop, a crafting table or your inventory's "use" button consume a murphy_doctor item with every effect (animation, hunger and thirst, alcohol, infection roll, addiction), trigger the server flow instead of copying it:
The item must be a key of Config.Consumables.Items and the player must own it (it is removed).
Job and doctor detection
Who counts as a doctor is a configuration matter (Config.Interactions.DoctorDetection, Config.DoctorJobs,
Config.DoctorWhitelist, the dispensary members). When your job script changes a player's job, refresh both caches so
the change is immediate instead of up to 30 seconds later:
If you insert or delete rows of murphy_doctor_members yourself, also fire
TriggerEvent("murphy_doctor:server:membersChanged") on the server.
Target or radial menu
murphy_radialmenu is supported out of the box. Any other menu can use the same client events (see
Events), with the non-blocking exports for visibility:
Never call the blocking IsPlayerDoctor client export inside a visibility check.
Weather script
The temperature engine reads weathersync. Any other weather resource can feed it from the client each time the
weather changes:
Without any weather source the weather modifier stays neutral.
Vitals and character creator scripts
- murphy_doctor does not restore the ped's health when a character loads; your framework or vitals script keeps that job.
- Each time murphy_doctor deliberately writes the ped's health, it fires the local client event
murphy_doctor:scriptedHealthChangewith{ reason, from, to, max }. Listen to it so your script does not revert the change. - A creator can publish the character's skin tone for the surgery and injection patches.
Diseases and vaccines
Animations and consumables
- Animation catalog:
Config.Animations(shared/config_animations.lua) holds every doctor animation (dict/clip, scenario or phased intro/action/outro, with props). Change an entry to change the animation everywhere it is used, or add your own entries and play them from your resource withexports.murphy_doctor:PlayDoctorAnim("my_key"). - Consumable animations: an item of
Config.Consumables.Itemsnames a preset inanimation; the preset ofConfig.Consumables.AnimationPresetseither names a function ofConsumableAnims(animFn, with optionalanimFnArgs) or gives a plain dict/anim. The functions live inclient/consumables_anims.lua, which you can edit or extend.
Logs
- Discord: built in, configured in
Config.DiscordLogs(shared/config_metabolism.lua), with one webhook per log type inDoctorWebhooks(server/adapters/webhooks.lua, server only). See Integrations. - Activity feed: every medical action is pushed through the local server event
murphy_platform:pushCustomEvent. Listen to it to build your own logs, even withoutmurphy_platform(payload in Events).
Debug tools
Config.Debug = true(shared/config.lua) prints debug lines and registers the test commands (/doc:testinjury,/doc:clearinjuriesand more). See Commands and keybinds. Thedbg(...)helper defined in the same file prints only whileConfig.Debugis on.- Module debug switches:
Config.Infection.Debugmirrors infection rolls to the player's F8 console,Config.Alcohol.Debugprints liver wear changes. doc_selftest [serverId]in the server console (or theRunSelfTestexport) checks adapter functions, dependencies, tables, item names and known conflicts./doc:close(always available) closes every murphy_doctor screen and gives the mouse back.
Editing client files and adapters
client/, shared/ and server/adapters/ are readable and editable. Some useful places:
| File | What you can change |
|---|---|
client/adapters/<Framework>Adapter.lua |
Revive after the coma timer (FrameworkRevivePlayer), framework notifications, character-load and revive bridges |
server/adapters/<Framework>Adapter.lua |
Identifiers, money, items, usable items, framework dead flag, admin revive hooks |
client/notify.lua |
Native notification look, threshold warning rules |
client/temperature.lua |
Weather sources and clothing detection of the temperature engine |
client/consumables_anims.lua |
Consumable animation functions |
shared/locales/*.lua |
Every Lua text (see Localization) |
ui/build/locales/*.js |
Every UI text |
Prefer the configuration, exports and events above: an edited file has to be merged by hand at each update. Keep a list of your changes, or keep them in a separate resource that calls the exports.
Last updated: November 20, 2026