Metabolism System
CAS Metabolism - Configuration & Exports Guide
Table of Contents
Configuration Files
Client Config
Server Config
Shared Config
Item Configuration
Client Exports
Server Exports
Configuration Files
Client Config
File: config/client_config.lua
Basic Settings
Config.SettingsMenuCommand = "hudsettings"Command to open the HUD settings menu.
Command to toggle HUD visibility on/off.
Command to show HUD while sprinting.
Voice system for microphone display. Options: "pma", "salty", "mumble", "auto"
Notification system to use. Options: "cas-simplenotify", "cas-notification", "vorp", "rsg"
Use CAS progress bar for item consumption animations.
Maximum health value (framework dependent). Used for health bar calculations.
Default HUD theme for new players. Options: "western", "minimal", "wave"
Metabolism Decay Settings
Base hunger decrease: Every 10 seconds, hunger decreases by 0.4% (idle/walking).
Base thirst decrease: Every 15 seconds, thirst decreases by 0.4% (idle/walking).
Increased decay rates while running/sprinting.
Set to true to continue decreasing stats while player is AFK.
Activity Multipliers
Multipliers for hunger/thirst decay based on player activity.
idle: Barely moving
walk: Walking speed
run: Jogging
sprint: Full sprint
coast: Standing still
swim: Swimming
mounted: On horseback
Starvation & Dehydration
Seconds to wait after both hunger and thirst reach 0 before health damage starts. Set to 0 to disable.
Seconds between health damage ticks when starving/dehydrated.
Health points removed per tick when starving. Set to 0 to disable damage.
Stress System
Enable/disable the stress system.
Enable screen shake effect when stress is high.
Settings explained:
minimumSpeedMph: Speed (MPH) needed to start gaining stress from travelspeedStressMin/Max: Random stress amount added per checkshootingStressChance: Probability (0.0-1.0) of gaining stress when shootingeffectMinimumSeverity: Stress % when visual effects startshakeIntensityMin/Max: Screen shake strength rangedamageSeverityThreshold: Stress % when health damage beginsdamageDelayMinutes: Time before damage starts at high stressdamageAmount: HP removed per tick
Sleep System
Sleep Settings:
gainPerMinute: How fast sleep accumulates per activity type (higher = faster fatigue)drunkGainMult: Sleep builds 20% faster when drunk above thresholdlowNeedGainMult: Sleep builds 15% faster when hunger/thirst below thresholddrowsy.startAt: Sleep % when blinking effects start (90%)microsleep.startAt: Sleep % when brief blackouts can occur (95%)knockout.startAt: Sleep % when full knockout is possible (99%)beds.reducePerSecond: How much sleep decreases per second when sleeping in bedbeds.entries: Add bed/bedroll models where players can sleep
Cleanliness System
MinCleanPercent: Cleanliness % threshold for warningsPenaltyIntervalSeconds: Damage frequency when too dirtyDamagePerTick: HP damage per tickDoFx: Apply visual dirt effects
Temperature System
Temperature range in Celsius.
Health damage from extreme temperatures.
Seconds between temperature warnings.
Extra thirst drain in hot weather.
Indoors temperature adjustment toward comfortable level.
Warmth bonus from nearby campfires.
Intoxication System
Walking styles applied at different drunk levels.
Vomiting system when too drunk or overeating/drinking.
Prevents overeating/overdrinking. After triesToVomit attempts, player vomits.
HUD Colors
Default HUD element colors (hex format).
Color Presets
Pre-made color themes players can select. Each preset contains:
hudColors: Progress bar colorsiconColors: Icon colors when fullemptyIconColors: Icon colors when empty
Minimap Styles
Available minimap style options.
Warning & Need Decay
Seconds to wait before decay begins after refilling hunger/thirst (5 minutes grace period).
Hunger/thirst % at which warnings trigger.
Seconds between repeated warnings.
Server Config
File: config/server_config.lua
Settings:
Enabled: Enable MySQL database persistenceTable: Database table nameSaveIntervalMs: How often to save data (60000ms = 1 minute)AlsoSyncFramework: Also update framework's status system for compatibilityUseCharacterIdentifier: Use character-specific storage (multi-character support)Debug: Enable debug prints
Shared Config
File: config/shared_config.lua
Tobacco Prompts
Key bindings for tobacco system.
Item Configuration
File: config/shared_config.lua (inside Config.ItemsToUse table)
Item Structure
Each item in Config.ItemsToUse follows this format:
Field Descriptions
Name
String
Item spawn code (must match framework item)
Thirst
Number
Thirst points restored (0-100 scale but can exceed)
Hunger
Number
Hunger points restored (0-100 scale but can exceed)
Metabolism
Number
Metabolism boost
Stamina
Number
Stamina points added
InnerCoreHealth
Number
Inner health core boost
OuterCoreHealth
Number
Outer health core boost
stress
Table
Stress modification: mode = "increase" or "decrease", value = amount
drunk
Table
Intoxication modification: mode = "increase" or "decrease", value = amount
Animation
String
Animation type: "eat", "drink", "coffee", "stew", "smoke", "chew", "bandage", "syringe"
SmokeEvent
String
For tobacco items, custom prop event
Effect
String
Visual effect name (e.g., "PlayerDrunkSaloon1")
EffectDuration
Number
Effect duration in minutes
PropName
String
3D prop model to display during consumption
GiveBackItemLabel
String
Display name of returned item
GiveBackItem
String
Item spawn code to return after use (e.g., empty bottle)
GiveBackItemAmount
Number
Amount of returned item
InnerCoreHealthGold
Number
Duration (minutes) of gold inner health core
OuterCoreHealthGold
Number
Duration (minutes) of gold outer health core
InnerCoreStaminaGold
Number
Duration (minutes) of gold inner stamina core
OuterCoreStaminaGold
Number
Duration (minutes) of gold outer stamina core
coffeeBuff
Table
Coffee buff settings (see below)
Coffee Buff System
enabled: Enable coffee buffdurationMinutes: How long buff lasts (reduces sleep accumulation rate)sleepReduction: Immediately reduce sleep by this amount when consumed
Example Items
Food:
Drink:
Coffee with Buff:
Tobacco:
Medical:
Client Exports
All client exports are used from other scripts like this:
Generic Getters & Setters
Get Value
Get any metabolism value by path.
Parameters:
keyPath(string): Path to the value (e.g.,"hunger","health.inner")
Returns: The value or nil if not found
Set Value
Set any metabolism value by path.
Parameters:
keyPath(string): Path to the valuevalue(any): New value to setopts(table, optional):apply(boolean): Apply health/stamina changes to game immediatelyflush(boolean): Force immediate server sync
Returns: true on success, false on failure
Add Value
Add or subtract from a numeric value.
Parameters:
keyPath(string): Path to the numeric valuedelta(number): Amount to add (negative to subtract)opts(table, optional): Same asSetoptions
Returns: true on success, false on failure
Get All Values
Get all metabolism values at once.
Returns: Table with all current metabolism data
Specific Getters & Setters
Hunger
Thirst
Stress
Drunk
Sleep
Health (Inner/Outer)
Stamina (Inner/Outer)
Advanced Functions
Apply Vitals
Manually apply health/stamina values from metabolism data to the game.
Useful after making multiple changes and wanting to apply them all at once.
Usage Examples
Hunger Penalty System:
Reward System:
Health Check:
Force Full Recovery:
Server Exports
All server exports are used from other scripts like this:
Level System Exports
Get XP
Get a player's current XP amount.
Parameters:
identifier(string): Character identifier
Returns: XP amount (number)
Add XP
Give XP to a player.
Parameters:
amount(number): XP to addidentifier(string): Character identifiersource(number): Player server ID
Notes:
Automatically handles level-ups (100 XP = 1 level)
Updates client HUD automatically
Saves to JSON file
Remove XP
Remove XP from a player (can cause level down).
Parameters:
amount(number): XP to removeidentifier(string): Character identifiersource(number): Player server ID
Notes:
Can reduce level if XP goes below 0
Minimum level is 1
Get Level
Get a player's current level.
Parameters:
identifier(string): Character identifier
Returns: Level (number)
Get Level Data
Get complete level data for a player.
Parameters:
identifier(string): Character identifier
Returns: Table with { xp = number, level = number } or nil
Server Export Usage Examples
Mission Reward System:
Level-Based Permissions:
Death Penalty:
Leaderboard System:
Tips & Best Practices
Configuration Tips
Balance Difficulty: Adjust
ActivityMultipliersto make survival easier or harderGrace Periods: Use
NeedsDecayStartDelayto give players time after eating/drinkingStress Management: Adjust
StressSettings.shootingStressChancefor roleplay vs combat serversSleep System: Modify
gainPerMinutevalues to make sleep more/less demandingVisual Effects: Disable
EnableShakeEffectForStressif players find it annoying
Export Best Practices
Client Side:
Always check return values when using
Get()functionsUse
apply = trueoption when changing health/stamina for immediate effectBatch multiple changes before applying vitals for better performance
Server Side:
Always validate
identifierbefore using level functionsStore character identifier once instead of calling
GetPlayerIdentifierrepeatedlyConsider XP balancing: 100 XP per level is default, plan rewards accordingly
Common Patterns
Stat Check Before Action:
Full Status Reset:
Progress Tracking:
For additional support or questions, refer to the script's main files or contact the developer.
Last updated