Code After Sex
  • Introduction
  • Store
  • Discord
  • About PAID Scripts
    • 🆙PLEASE READ!
    • 📄RedM Script Documentation
      • Metabolism System
      • Animation Menu
      • Pausemenu Remake
        • Installation
        • Editable Files
        • Dependencies
      • New Player & Anti troll
      • Store & Shops
      • Tebex & VIP Shop
      • Multicharacter (Vorp)
      • Inventory
      • Wholesaler
      • Spawn System
      • Pause Menu
      • Dailygift
      • Loading Screen
      • Multicharacter (RSG, MBL)
      • CAS-Adminmenu V2
      • CAS-Multicharacter
      • RSG Multicharacter V2
      • CAS-Notification
      • Progressbar
      • Radial Menu
      • VORP Multicharacter (Tebex Integrated)
      • Vote Script
    • 📄FiveM Script Documentation
      • CAS-Dispatch
  • About FREE Scripts
    • FiveM Script Documentation
  • About CFX Auth System
    • CFX auth system
Powered by GitBook
On this page
  • Installation
  • Exports
  • getMetabolismValue
  • setMetabolismValue
  • addXP
  • removeXP
  • getLevel
  1. About PAID Scripts
  2. RedM Script Documentation

Metabolism System

Installation

  1. Download the purchased file from Keymaster.

  2. Extract the contents from the .zip file.

  3. Move the extracted folder into your resources directory.

  4. Add the following line to your server.cfg:

    ensure cas-metabolism
  5. Restart your server.

You're good to go! 🎉

Exports

Client Side

getMetabolismValue

--@param metabolism string [stamina, hunger, thirst, stress, dirt, microphone, weather, drunk, horsehealth, horsestamina, health]
RegisterCommand("getMetabolismValue", function(metabolism)
    local val = exports["cas-metabolism"]:getMetabolismValue(metabolism)
    if val == nil then 
        return print("\27[31m[CAS-Metabolism] Invalid metabolism key: " .. metabolism .. "\27[0m")
    end
    if type(val) == "table" then
        print("\27[32m[CAS-Metabolism] " .. metabolism .. ": inner: " .. val.inner .. ", outer: " .. val.outer .. "\27[0m")
    else
        print("\27[32m[CAS-Metabolism] " .. metabolism .. ": " .. val .. "\27[0m")
    end
end)

setMetabolismValue

--@param metabolism string [stamina, hunger, thirst, stress, dirt, microphone, weather, drunk, horsehealth, horsestamina, health]
--@param value number [0-100] or table [inner, outer]
RegisterCommand("setMetabolismValue", function(metabolism, value)
    if metabolism == nil then 
        return print("\27[31m[CAS-Metabolism] Metabolism is nil!\27[0m")
    end
    exports["cas-metabolism"]:setMetabolismValue(metabolism, value)
end)

Server Side

addXP

--@param amount number 
--@param identifier string [steam, license, discord, xbl, live]
--@param source number [source]
RegisterCommand("addXP", function(source, args, rawCommand)
    local amount = tonumber(args[1])
    local identifier = args[2]
    if (amount == nil)  then
        return print("\27[31m[CAS-Metabolism] Amount is nil!\27[0m")
    end
    if (identifier == nil) then
        return print("\27[31m[CAS-Metabolism] Identifier is nil!\27[0m")
    end
    exports["cas-metabolism"]:addXP(amount, identifier, source)
end)

removeXP

--@param amount number 
--@param identifier string
RegisterCommand("removeXP", function(source, args, rawCommand)
    local amount = tonumber(args[1])
    local identifier = args[2]
    if (amount == nil)  then
        return print("\27[31m[CAS-Metabolism] Amount is nil!\27[0m")
    end
    if (identifier == nil) then
        return print("\27[31m[CAS-Metabolism] Identifier is nil!\27[0m")
    end
    exports["cas-metabolism"]:removeXP(amount, identifier, source)
end)

getLevel

RegisterCommand("getuserlevel", function(source)
    local src = source
    local identifier = "steam:......."
    local userLevel = exports["cas-metabolism"]:getLevel(identifier, source)
    print("\27[32m[CAS-Metabolism] User level: " .. userLevel .. "\27[0m")
end)

⚠️ Please disable all other metabolism scripts!

PreviousRedM Script DocumentationNextAnimation Menu

Last updated 1 month ago

📄