Here is my code
local model = workspace.Plots["1"].Building model.ChildAdded:Connect(function() for name, child in pairs(model:GetChildren()) do child:FindFirstChild("Hitbox").Touched:Connect(function(hit) if hit.Parent ~= child then child:Destroy() end end) end end)
The child is a model and it has a part under it called Hitbox but in the console it is saying attempt to index nil with Touched
inside ChildAdded, pass the child that gets created and make sure it is the hitbox and then use the touched event
ChildAdded:Connect(function(child) --code end)