Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to detect a part being deleted?

I now of if part == nil then but I have multiple parts that are the same name. I need it to trigger a function every time one is removed. Is there a method?

1 answer

Yeah, there is an even for that:

part.Parent.ChildRemoved:connect(function(child)
--Child is the part that got removed
end)

Now, it doesn't need to be exactly part.Parent, it's just the model that contains those parts.

1 comment

0

I would add an if statement checking if the child removed was the same part as "part"

This discussion is preserved as it was. New answers, comments, and votes are closed.