Novelty scripting reference > Scripted events > OnDestroy

OnDestroy

This event is called when the object is destroyed by either a script call or at the end of the page.


Implicit arguments

Object@ sender
Handle to the associated object.


Sample

event MyEvent.OnDestroy
{
	// Print object's name to the console 
	Print(sender.name + " was destroyed");
}

Back to top