For the complete documentation index, see llms.txt. This page is also available as Markdown.

Client Exports

GetStatus

Returns a status controller for the specified player and status.

---@param {statusName: string}: Status name defined in Config.Statuses
---@return {status: table}: Status controller with Set, GetPercentage, Add and Remove functions
local status = exports['vms_needs']:GetStatus(statusName)
Example Usage
local hunger = exports['vms_needs']:GetStatus('hunger')

hunger.Set(300)

print(hunger.GetPercentage())

hunger.Add(50)
hunger.Remove(25)
Returned Functions
{
    Set = function(value)
        -- Sets the raw status value.
    end,

    GetPercentage = function()
        -- Returns the current status value as a percentage from 0 to 100.
    end,

    Add = function(value)
        -- Adds the specified value to the status.
    end,

    Remove = function(value)
        -- Removes the specified value from the status.
    end,
}

GetStatuses

Returns a list of all registered player statuses.

---@return {statuses: table}: Status data indexed by status name
local statuses = exports['vms_needs']:GetStatuses()
Example Returned Data

GetPercentageStatus

Returns the current status value as a percentage (0-100).


SetStatus

Sets the raw value of the status.


AddStatus

Adds a raw value to the status.


RemoveStatus

Removes a raw value from the status.


CleanupOptionalStatuses

Clear all statuses if they are marked as isOptional in Config.Statuses.


GetServerTemperature

Returns the current ambient server temperature.


GetServerFeelsLikeTemperature

Returns the current perceived temperature based on weather conditions.


GetPlayerBodyTemperature

Returns the player's current body temperature and thermal state.

Example
Available States

The following thermal states may be returned by this export.

State
Description
Temperature Range

NORMAL

Normal body temperature

36.0 - 37.5 °C

WARM

Slightly elevated body temperature

37.5 - 38.0 °C

HOT

Elevated body temperature

38.0 - 39.0 °C

OVERHEATED

Dangerously high body temperature

> 39.0 °C

CHILLED

Slightly reduced body temperature

35.2 - 36.0 °C

COLD

Low body temperature

34.0 - 35.2 °C

HYPOTHERMIA

Dangerously low body temperature

< 34.0 °C


OverwriteTemperature

Overrides the ambient temperature for the local player until disabled. Useful for interiors or controlled environments where the perceived temperature should differ from the outside world.

The player's body temperature will not change instantly. It will gradually adjust toward the overridden ambient temperature according to the configured temperature system.

Example

GetPlayerCold

Returns the player's current cold factor.

The returned value is normalized between 0.0 and 1.0 and can be used to scale custom gameplay effects.


GetPlayerHeat

Returns the player's current heat factor.

The returned value is normalized between 0.0 and 1.0 and can be used to scale custom gameplay effects.


GetUsingItem

Returns the currently active item, including its name, metadata and configured type.

Example

CancelItemUsage

Cancels the current item usage by either hiding or dropping the item, depending on the specified action and item behavior.

Note: Not all items support both actions. For example, lit cigarettes cannot be returned to the inventory, while some items (such as a breathalyzer) cannot be dropped. In these cases, the item's configured behavior is applied automatically.

Example

GetBreathalyzerReading

Calculates and returns the current breathalyzer reading using the player's drunk status and the configured alcohol settings.

Note: The returned values are calculated using the current drunk status and the settings defined in Config.Alcohol.

Example Returned Data
Returned Fields
Field
Description

drunkPercent

Current drunk status as a percentage (0–100).

permille

Calculated blood alcohol concentration (‰).

mgL

Calculated breath alcohol concentration (mg/L).


ReloadVisualEffect

Reapplies the active VMS Needs visual effect after another resource overrides or clears the current timecycle modifier.

Use this export after reviving a player or whenever another resource temporarily applies its own screen effect.


GetConfig

Last updated