API:Class/Instance/Destroy

Destroy

Function of Object Icon.pngInstance
void Destroy ()

Returns: void
Description: Sets the Parent property to nil, locks the Parent property, disconnects all connections and calls Destroy() on all children.

Notes

  • This will throw an error if you attempt to destroy a service.

Example

local Part = Workspace.Part
Part:Destroy()
Part.Parent = Workspace --> The Parent property of Part is locked