Skip to main content

Destroyed

Fires a callback function when an instance hydrated or created with New gets destroyed.

TypeSinceScoped
Declaration0.3.3No

Constructor

[Destroyed] = () -> nil

Usage

Destroyed allows you to attach a callback function to an instance when it destroyed.

It works like this:

local New = Seam.New
local Destroyed = Seam.Destroyed

local Object = New("ScreenGui", {
[Destroyed] = function()
print("I've been destroyed!")
end,
})

Object:Destroy() -- Prints "I've been destroyed!"