I tried making a loop so every time a UFO is found in workspace, it gets removed. This is extremely inefficient so what's the best, most efficient way to make the UFO get removed?
while true do for k,v in pairs(game.Workspace:GetChildren()) do if v.Name == 'UFO' then v:Destroy(); end; end; end
There is an event which fits perfectly for your scenario called ChildAdded:
local debris = game:GetService("Debris") game.Workspace.ChildAdded:connect(function(child) if child.Name == "UFO" then debris:AddItem( child, 0 ) end end)
I used debris service instead of destroy, because if you try to destroy at same time when it's added, it would error, since it's still trying to parent it. Adding wait() before destroying it would work as well, but I wished to do it this way.