M MY Multiplayer: Wiki
Side
Kind

getElementData

Shared

Reads a value stored on an element.

any|false getElementData(element element, string key)

Parameters

NameTypeDescription
elementelementThe element holding the data.
keystringThe data's key. Keys longer than 128 characters are cut, with a warning.

Returns

The value stored under the key, or false if there is nothing there.

Example

local money = getElementData(localPlayer, "money") or 0
outputDebugString("You have $" .. money)
Coming from MTAThere is no inherit argument: only the element's own data is read.

See also