- Documentation
- Shared functions
- destroyElement
Function
destroyElement
Destroys an element together with its children. On the client it also destroys GUI elements.
Syntax
bool destroyElement(element elementToDestroy)Arguments
elementToDestroyelement- The element.
Returns
true on success.
Example
local car = createVehicle(411, 0, 0, 3)
setTimer(function()
if isElement(car) then destroyElement(car) end
end, 60000, 1)
See also
isElementChecks whether a value is an existing element. Use it before acting on an element that may have been destroyed.onElementDestroyAn element is about to be destroyed (it still exists).createElementCreates an element of your own type, e.g."house"or"zone". It sits under the current resource root and disappears when the resource stops. Useful for grouping elements and storing data.