Exports

Here is a list of all the exports that can be used

#Client

· GetNeeds: Returns a table with the current needs values.

Example

local needs = exports.bm_human_needs:GetNeeds()
print(json.encode(needs, { indent = true}))
--returns: { sleep = value, pee = value, poo = value, dirt = value }

· SetNeeds: Set the table of needs values ​​to those entered.

Example

local needs = exports.bm_human_needs:GetNeeds()
needs.poo = 50
exports.bm_human_needs:SetNeeds(needs) --Take needs table as argument

· UpdateNeed: Set value of specific need to entered one

Example

exports.bm_human_needs:UpdateNeed('pee', 50) --Set pee value to 50

· StartPee: Starts peeing action

Example

exports.bm_human_needs:StartPee() --Ped starts peeing, it will check pee level first

· TogglePoop: Toggles pooping action

Example

exports.bm_human_needs:TogglePoop() --Toggles ped pooping action, it will check poop level first

· IncreaseNeedOverTime: Increases the value of a need every second for a certain time

Example

--Arguments: need, amount removed, time(milliseconds)
exports.bm_human_needs:IncreaseNeedOverTimeoop('pee', 1, 3000) --This will reduce pee by 1 every second for 3 seconds.

· DecreaseNeedOverTime: Decreases the value of a need every second for a certain time

Example

exports.bm_human_needs:DecreaseNeedOverTime('poo', 2, 5000) --This will reduce poo by 2 every second for 5 seconds.

· IsNeedsMenuOpen: Returns if needs menu is open

Example

local open = exports.bm_human_needs:IsNeedsMenuOpen() --Returns boolean

· IsResting: Returns if player is sleeping

local sleeping = exports.bm_human_needs:IsResting() --Returns boolean

Last updated