of     1   

OG_Overlord
#182302346Sunday, January 24, 2016 12:58 PM GMT

How would I go about destroying all the items under StarterGear? I don't need to remove or clearallchildren. I really need to destroy them all at once. Thanks in advance awesome scripters. Raise your DONGERS (ง ° ͜ ʖ °)ง?!?!? -Pixel Vibez
MightyDantheman
#182302504Sunday, January 24, 2016 1:03 PM GMT

Why wouldn't you use ClearAllChildren()? It's the same as destroying each child of StarterGear. Otherwise, I don't really understand what you're saying. ~MightyDantheman
OG_Overlord
#182325685Sunday, January 24, 2016 7:27 PM GMT

Clearallchildren "removes" not "destroys". I have to use the destroy() method Raise your DONGERS (ง ° ͜ ʖ °)ง?!?!? -Pixel Vibez
[rfa#hidefromsearch]
#182325733Sunday, January 24, 2016 7:27 PM GMT

[rfa#hidefromsearch]
wonderful72pike
#182325788Sunday, January 24, 2016 7:28 PM GMT

for _, v in ipairs(StarterGear:GetChildren()) do v:Destroy() end
[rfa#hidefromsearch]
#182325853Sunday, January 24, 2016 7:29 PM GMT

[rfa#hidefromsearch]
wonderful72pike
#182326003Sunday, January 24, 2016 7:32 PM GMT

Right but I don't know how his script is set up so I put that there in place of a variable he might be using.
cgjnm
#182328109Sunday, January 24, 2016 7:57 PM GMT

StarterGear? You mean game.StarterPack, game.StarterGui, game.StarterPlayer, player.Backpack, player.PlayerGui? Or what do you mean?
cgjnm
#182328220Sunday, January 24, 2016 7:58 PM GMT

But whatever it is, do this: repeat wait() until #StarterGear:GetChildren() > 0 for i,v in pairs(StarterGui:GetChildren())do v:Destroy() end
OG_Overlord
#182368665Monday, January 25, 2016 5:42 AM GMT

Sorry for the late reply, first of all thanks for all the help guys! BUT unfortunately none of the answers have worked this far the output error I keep getting is: Players.Player1.Backpack.Angel.EatScript:27: attempt to index a nil value I'd say StarterGear is nil in some way? Is there anyway I can fix that? Raise your DONGERS (ง ° ͜ ʖ °)ง?!?!? -Pixel Vibez
OG_Overlord
#182369525Monday, January 25, 2016 6:03 AM GMT

Bump Raise your DONGERS (ง ° ͜ ʖ °)ง?!?!? -Pixel Vibez
spinywind
#182370191Monday, January 25, 2016 6:23 AM GMT

local Children = script.parent.Startergear:GetChildren() local x = AMOUNT OF CHILDREN for i = x, #Children do i, Children[11]:Destroy() end asuming this is in workspace
PhoenixSigns
#182370199Monday, January 25, 2016 6:24 AM GMT

What's the difference between remove and destroy...
OG_Overlord
#182370548Monday, January 25, 2016 6:35 AM GMT

Remove -If the object is referenced before being removed it is possible to retrieve the object at a later point. Destroy -Sets the Parent property to nil, locks the Parent property, disconnects all connections and calls Destroy() on all children. Raise your DONGERS (ง ° ͜ ʖ °)ง?!?!? -Pixel Vibez
OG_Overlord
#182372981Monday, January 25, 2016 7:57 AM GMT

Bump Raise your DONGERS (ง ° ͜ ʖ °)ง?!?!? -Pixel Vibez
OzzyFin
#182373039Monday, January 25, 2016 7:59 AM GMT

ClearAllChildren uses destroy even if wiki states otherwise local part = workspace.Model.Part workspace.Model:ClearAllChildren() part.Parent = workspace >error
OG_Overlord
#182373330Monday, January 25, 2016 8:14 AM GMT

I've been using Clearallchildren but it's not working so well for the script. I believe destroy would fix the problems, that's why i'm trying to use it. That being said, bump. Raise your DONGERS (ง ° ͜ ʖ °)ง?!?!? -Pixel Vibez
PhoenixSigns
#182388334Monday, January 25, 2016 5:41 PM GMT

Why does it matter if it can be retrieved later?
DeepBlueNoSpace
#182388419Monday, January 25, 2016 5:43 PM GMT

?? Do you want to empty what is in the players backpack? game.Players.LocalPlayer.BackPack:GetChildren() should work just fine.

    of     1