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

Removing something everytime it appears in workspace?

How would I make it so the UFO gets removed every time it appears in workspace?

for _, child in pairs( workspace.Model:GetChildren()) do
    if child.Name = "UFO" then
      child:Destroy()
    end
end

1 answer

✓ Accepted answer

To do this its best to use the ChildAdded event. To do this you would basically write this:

game.Workspace.ChildAdded:connect(function(child)
	if child.Name == "UFO" then
		child:Destroy()
	end
end)

1 comment

0

Our code is exactly the same but because used a link and were first you win. Ill delete my answer xD

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