Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Echtic 128
4 years ago
Edited 4 years ago

The question is pretty self explanatory

1 answer

Log in to vote
0
Answered by
RAFA1608 543 Moderation Voter
4 years ago

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
0
Object:ClearAllChildren() also works. User#20279 0 — 4y
Ad

Answer this question