M MY Multiplayer: Wiki
Side
Kind

setElementParent

Shared

Makes an element a child of another in the element tree.

bool setElementParent(element element, element parent)

Parameters

NameTypeDescription
elementelementThe element to move.
parentelementThe new parent.

Returns

true if it changed, false if the element is a system one (such as root), came from the server (on a client), or the new parent is the element itself or one of its descendants.

Example

local group = createElement("race-group")
local car = createVehicle("infernus", 2495, -1687, 13.5)
setElementParent(car, group)

destroyElement(group)

See also