Destroy (Method)

From Legacy Roblox Wiki
Jump to navigationJump to search
Destroy( )
Returns nil
Description: Sets the Parent property to nil, locks the Parent property, disconnects all connections and calls Destroy() on all children.
Member of: Instance


Example
local part = game.Workspace.Part

part:Destroy()

Destroy locks the Parent property of the object.

part.Parent = Workspace  --> The Parent property of Part is locked