M MY Multiplayer: Wiki
Side
Kind

onClientElementDestroy

ClientEvent

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

addEventHandler("onClientElementDestroy", 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("onClientElementDestroy", root, function()
    blips[source] = nil
end)

See also