OPX//77
CreatorsServer exports

GetPlayerData

Last updated on

The public view of a connected player's loaded character.

local res = exports.opx_infinity:GetPlayerData(source)

Scope read · sync.

Parameters

  • source: number — a connected player id

Returns

  • { source, citizenId, userId, firstName, lastName, money, job, gang, jobs, gangs } — no metadata
    • money, job, gang, jobs, gangs have the shapes of the Player object.

Errors

  • export.badArgument, error.notLoggedIn
Example
local res = exports.opx_infinity:GetPlayerData(source)
if res.ok then print(res.value.firstName, res.value.citizenId) end

On this page

No Headings