ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setElementParent

Function

setElementParent

ServerElementsIdentical to MTA:SA

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)

See also