Skip to content

🍗 Metabolism ​

Documentation relating to the spooni_metabolism.

1. Installation ​

spooni_metabolism needs spooni_libs (it works alongside your framework through its bridge).

To install spooni_metabolism:

  • Download the resource
  • Ensure that all requirements are installed
  • Drag and drop the resource into your resources folder
    • spooni_metabolism
  • Add this ensure in your server.cfg (after spooni_libs and oxmysql)
    bash
    ensure oxmysql
    ensure spooni_libs
    ensure spooni_metabolism
  • Add the consumable items you want to your inventory database (item + image), then list them in config.lua so they become usable (food, drinks, alcohol, drugs, medicine).
  • Now you can configure and translate the script as you like
    • config.lua
    • language.lua
  • At the end, restart the server

TIP

The HUD settings and metabolism data tables are created automatically on first start — no SQL import needed.

If you have any problems, you can always open a ticket in the Spooni Discord.

2. Usage ​

Players carry a custom Red Dead-style HUD that tracks hunger, thirst, stress, dirtiness and reputation, plus health / stamina cores, horse stats, temperature, a voice indicator and an in-game clock.

Needs drain over time and are refilled with usable food, drinks, alcohol, drugs and medicine registered through spooni_libs; everything is saved in the database and persists across relog. Players reposition, scale and hide HUD icons with /sethud.

Other scripts plug in through clean exports — housing sends a status icon, stable scripts send horse metabolism, and medic scripts (like spooni_medic) can pause metabolism or trigger diseases.

3. For developers ​

Server exports

Read and change a player's needs (the HUD updates live). All values are clamped to their 0–100 range.

lua
-- hunger / thirst / stress
exports.spooni_metabolism:AddHungry(source, amount)
exports.spooni_metabolism:RemoveHungry(source, amount)
local h = exports.spooni_metabolism:GetHungry(source)
exports.spooni_metabolism:AddThirsty(source, amount)
exports.spooni_metabolism:RemoveThirsty(source, amount)
exports.spooni_metabolism:AddStress(source, amount)
exports.spooni_metabolism:RemoveStress(source, amount)

-- reputation
exports.spooni_metabolism:AddRep(source, amount)
exports.spooni_metabolism:RemoveRep(source, amount)
local rep = exports.spooni_metabolism:GetRep(source)

-- the whole metabolism table for a player
local meta = exports.spooni_metabolism:GetBodyMetabolism(source)

-- housing icon on the HUD
exports.spooni_metabolism:SetHousing(source, state)
exports.spooni_metabolism:HousingIcon(source, show)
Client events

Events other scripts can trigger on the client.

lua
-- send horse stats to the HUD (stable scripts)
TriggerEvent("spooni_metabolism:CLIENT:SENDHORSE", data)
-- pause metabolism while a player is hospitalized (medic scripts)
TriggerEvent("spooni_metabolism:CLIENT:MEDICALCABINET", bool)
-- apply a disease effect (medic scripts)
TriggerEvent("spooni_metabolism:CLIENT:DISEASE", disease)