PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Instance.DescendantRemoving

Instance.DescendantRemoving

Oct 01 2018, 2:09 AM PST

The following example prints the name of any descendant as it is being removed from the Workspace:

workspace.DescendantRemoving:Connect(function(descendant)
	print(descendant.Name .. " is currently parented to " ..  tostring(descendant.Parent))
end)
local part = Instance.new("Part")
part.Parent = workspace
part.Parent = nil
--> Part is currently parented to Workspace
print(part.Parent)
--> nil