You want to remove all parts coming into the Workspace and bring ones that have been removed back to the workspace.
Workspace.ChildAdded:connect(function(p) if p:IsA('BasePart') then p:Destroy() end end) Workspace.ChildRemoved:connect(function(p) if p:IsA('BasePart') then p.Parent = Workspace end end)
We simply connect both events, check if what’s leaving is a
BasePart, and if so, apply the appropriate behavior.
Instance/ChildAdded will fire when a new Instance is parented to the object (in this case Workspace). Note that they must be direct children in order to fire. So doing
Instance.new('Part', Workspace) would make it fire, but
Instance.new('Part', Workspace.Model) would not. The same with the