M MY Multiplayer: Wiki
Side
Kind

getElementByID

Shared

Finds the first element with an ID, starting at an element and going down through its children.

element|nil getElementByID(string id [, element startAt = root])

Parameters

NameTypeDescription
idstringThe ID to look for.
startAtelementWhere the search starts. It counts too.default root

Returns

The element found, or nil if none has that ID.

Example

local gate = getElementByID("lspd_gate", resourceRoot)
if gate then
    moveObject(gate, 3000, 1544.7, -1630.7, 10)
end

See also