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
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
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Our code is exactly the same but because used a link and were first you win. Ill delete my answer xD