M MY Multiplayer: Wiki
Side
Kind

onElementDestroy

ServerEvent

Fired when an element is about to be destroyed, while it still exists.

addEventHandler("onElementDestroy", root, function() … end)

Source

The element about to be destroyed.

When an element is destroyed, its children are destroyed before it, and each fires its own event.

Example

local blips = {}

addEventHandler("onElementDestroy", root, function()
    blips[source] = nil
end)

See also