- Documentation
- Server functions
- setElementParent
Function
setElementParent
Changes the element's parent in the tree. Destroying the parent destroys the children too.
Syntax
bool setElementParent(element theElement, element parent)Arguments
theElementelement- The element.
parentelement- The new parent.
Returns
true on success.
Example
local race = createElement("race")
for i = 1, 5 do
local cp = createMarker(i * 50, 0, 3, "checkpoint")
setElementParent(cp, race)
end
destroyElement(race)