Metabolism
Client Side
Start the Script
It's already set in the config.lua, remove lines 14-28 if you want to change it with your system.
Client Event
-- bt_metabolism:addToMetabolism
Client : TriggerEvent("bt_metabolism:addToMetabolism", 100) -> Add 100 Calories to metabolism, progressively
Server : TriggerClientEvent("bt_metabolism:addToMetabolism", source, 100)
-- bt_metabolism:removeToMetabolism
Client : TriggerEvent("bt_metabolism:removeToMetabolism", 150) -> Remove 150 Calories to metabolism, progressively
Server : TriggerClientEvent("bt_metabolism:removeToMetabolism", source, 150)
-- bt_metabolism:setMetabolism
Client : TriggerEvent("bt_metabolism:setMetabolism", 2100.0) -> set character metabolism to 2100.0
Server : TriggerClientEvent("bt_metabolism:setMetabolism", source, 2100.0)
Client exports
exports.bt_metabolism:getMetabolism() -- return 1450.0 Calories
exports.bt_metabolism:addToMetabolism(100) -- Add 100 Calories to metabolism.
exports.bt_metabolism:setMetabolism(2100.0) -- set character metabolism to 2100.0
exports.bt_metabolism:removeToMetabolism(150) -- Remove 150 Calories to metabolism.
Here is an excerpt from the config.lua file : (parts of the excerpt are hidden)
Config = {
DEFAULT_METABOLISM = 1500, -- Base metabolism, at character creation.
MAX_METABOLISM = 3000, -- Maximum metabolism before losing endurance.
MIN_METABOLISM = 100, -- Minimum metabolism before losing health.
-- LEVELS THAT ALLOW THE PLAYER TO VISUALLY GAIN OR LOSE WEIGHT IN THE GAME
WEIGHT_ONE = 800, -- Skinny
WEIGHT_TWO = 1200, -- Skinny>normal
WEIGHT_THREE = 1700, -- Normal>fat
WEIGHT_FOUR = 1800, -- Fat>big
WEIGHT_FIVE = 2000, -- Big
--
ALLOW_PENALITY = true, -- If a character is too overweight, he will lose stamina; If a character is too skinny, he will lose health.
-- IMPACT GLUCID VALUE
BASE_BURN_METABOLISM = 0.01, -- Calories burned while the player is at rest.
ON_HORSE_METABOLISM = 0.015, -- Calories burned when the player is on mount.
MOVE_BURN_METABOLISM = 0.02, -- Calories burned when the player is walking.
RUN_BURN_METABOLISM = 0.04, -- Calories burned when the player is running or swimming.
--
REFRESH_METABOLISM = 1, -- Calories are burned every X seconds.
REFRESH_SAVE_TIME = 60, -- Save player's metabolism in the file every x seconds.
HUNGRY_MSG = "La faim vous brΓ»le l'estomac...", -- Message when player is at minimum metabolism
}
-- this content is hidden in the excerpt
Last updated