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

Server Exports

GetStatus

Returns a status controller for the specified player and status.

---@param {source: number}: Player Server ID
---@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(source, statusName)
Example Usage
local hunger = exports['vms_needs']:GetStatus(1, '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,
}

GetPercentageStatus

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

---@param {source: number}: Player Server ID
---@param {statusName: string}: Status name defined in Config.Statuses
---@return {statusPercentage: number}: Current status value as a percentage (0-100)
local statusPercentage = exports['vms_needs']:GetPercentageStatus(source, statusName)

SetStatus

Sets the raw value of the specified player status.


AddStatus

Adds a raw value to the specified player status.


RemoveStatus

Removes a raw value from the specified player status.


CleanupOptionalStatuses

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


SaveStatus

Saves the status data for the specified player or all online players.


GetServerTemperature

Returns the current server temperature.

Last updated