How do I make a script that is constantly checking if there is a part in a parent and if it disappears it also detects it
try many ways but it doesn’t work. i try with while loop and if statement
(im new in scripting lol)
How do I make a script that is constantly checking if there is a part in a parent and if it disappears it also detects it
try many ways but it doesn’t work. i try with while loop and if statement
(im new in scripting lol)
I think these two events might help you with that.
https://developer.roblox.com/en-us/api-reference/event/Instance/ChildAdded
https://developer.roblox.com/en-us/api-reference/event/Instance/ChildRemoved
https://developer.roblox.com/en-us/api-reference/event/Instance/DescendantAdded
https://developer.roblox.com/en-us/api-reference/event/Instance/DescendantRemoving
and 2 more.
local Model = workspace:WaitForChild("Model")
Model.ChildRemoved:Connect(function(child) --model loses a child
if child.Name == "put part name here" then --lost child matches some particular part
--do stuff
end
end)