M MY Multiplayer: Wiki
Side
Kind

getElementChildren

Shared

Lists an element's direct children, optionally only those of one type.

table getElementChildren(element element [, string type = ""])

Parameters

NameTypeDescription
elementelementThe parent element.
typestringOnly return children of this type. Empty returns all.default ""

Returns

A table with the children, empty if there are none.

Grandchildren and anything further down are left out. To go down the whole tree, use getElementsByType.

Example

for _, vehicle in ipairs(getElementChildren(resourceRoot, "vehicle")) do
    setElementFrozen(vehicle, true)
end

See also