So for example, I have this script:
local model = workspace.Plots["1"].Building model.ChildAdded:Connect(function() for name, child in pairs(model:GetChildren()) do child:WaitForChild("Hitbox").Touched:Connect(function(hit) if hit.Parent ~= child then child:Destroy() end end) end end)
Basically, it creates a new part and if it is touching that other part it will check if it has the same parent. If it doesn't it will destroy that model.
local model = workspace.Plots["1"].Building model.ChildAdded:Connect(function() for name, child in pairs(model:GetChildren()) do child:WaitForChild("Hitbox").Touched:Connect(function(hit) if hit.Parent.Name == child.Parent.Name then child:Destroy() end end) end end)
boop