im trying to make a part break from this touch function but i want to make it so that it will only break when the parent has a child inside of it called "break". this is the only way i know of doing it. any help?
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("break") then script.Parent:Destroy() end end)
Your looking in the wrong area. hit is the part that touched your part. Your code should be this:
script.Parent.Touched:Connect(function(hit) if script.Parent:FindFirstChild("break") then script.Parent:Destroy() end end)