Hello, I want to detect when a part has been deleted.
I've got no idea how to do this.
Hello, I want to detect when a part has been deleted.
I've got no idea how to do this.
Hello, isaacjh100!
To detect when a part is removed/deleted you can use ChildRemoved or DescendantRemoving. The following code I'm about to show is using the ChildRemoved event.
workspace.ChildRemoved:Connect(function(child)
print(child)
end)
If you want it to run a something when a certain part is deleted you can do this:
workspace.ChildRemoved:Connect(function(child)
if child.Name == "Part" then
print("hey")
end
end)
You can edit this code to your liking.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thank you :)