CreatorsServer exports
GetMetadata
Last updated on
Reads your resource's own metadata on a character.
local res = exports.opx_infinity:GetMetadata(target, key)Scope read · sync for a loaded player · must be awaited when target is a citizen id.
Parameters
-
target:
number | string— a connected player id, or a citizen id (a character nobody is playing) -
key?:
string -
Each resource has its own space: your
keyis stored asext.<your resource>.<key>, so you cannot reach OPX's keys or another resource's. -
A citizen id reads the stored row when the character is not online (and memory when it is).
-
key: one segment, 1–48 characters, letters, digits,_and-(no dot).
Returns
any— the value of your key, or with nokeyevery key you stored as{ [key] = value }
Errors
export.badArgument,error.notLoggedIn,character.notFound,export.mustAwait
local res = exports.opx_infinity:GetMetadata(source, 'deliveries')
local done = res.ok and res.value or 0