M MY Multiplayer: Wiki
Side
Kind

destroyElement

Shared

Destroys an element and all of its children. Before it goes, each one fires onElementDestroy on the server or onClientElementDestroy on the client.

bool destroyElement(element element)

Parameters

NameTypeDescription
elementelementThe element to destroy.

Returns

true if it was destroyed. false if the element is already being destroyed or cannot be destroyed.

The root, resources, the console and players cannot be destroyed. On a client, neither can elements that came from the server.

Example

local marker = createElement("checkpoint")
setTimer(destroyElement, 10000, 1, marker)

See also