OPX//77
CreatorsClient exports

GetNeeds

Last updated on

Reads the local player's needs, as the server last sent them.

local res = exports.opx_infinity:GetNeeds()

Sync. Read only: the server owns the needs, and a client script cannot move them. To feed or drain a need, call the server exports AddNeeds / SetNeeds from your resource's server side.

Returns

  • { values, citizenId, ready }

Errors

  • no_character, not_loaded
Example
local res = exports.opx_infinity:GetNeeds()
if res.ok then print(res.value.values.hunger) end

On this page

No Headings