Is there such thing as CopyAllChildren()
or ClearAllChildren()
? if not then how would I clone clone or destroy the children that I got from something?
CopyAllChildren() doesn't exist as far as I know.
ClearAllChildren() does exist however. Here's an example for using it.
game.Workspace:ClearAllChildren() -- If its in workspace, it will be removed. game.Lighting:ClearAllChildren() -- If its in lighting, it will be removed. game.Teams:ClearAllChildren() -- If its in teams, it will be removed.
To clone something, its fairly simple. Here's an example.
game.Workspace.Part:Clone() -- This will clone the part named "Part."
However, you can also simply destroy one specific thing rather than destroying it all. There is two methods.
game.Workspace.Part:Destroy() -- This will destroy the part named "Part." game.Workspace.Part:Remove() -- This will remove the part named "Part."
I don't really see a difference between Destroy() and Remove(), but hey, it's your choice on what to use. I hope I was helpful. :)