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

How do i delete all of a certain object's children?

The question is pretty self explanatory

1 answer

this is not scripting givers, this is scripting helpers but whatever heres the script

local Object = game.Workspace.yourobjecthere -- sets object or something
for i,v in pairs(Object:GetChildren()) do -- scans thru all Object's children or something
	v:Destroy() -- the value i is index (number being scanned) and v is the value (object being scanned) or something (i suck at explaining stuff) and then destroys v
end

1 comment

0

Object:ClearAllChildren() also works.

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