getElementChildren
Shared
Lists an element's direct children, optionally only those of one type.
table getElementChildren(element element [, string type = ""])
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The parent element. |
| type | string | Only 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