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

what does this script mean i want to know can someone identify this for me?

for _, v in pairs(game:GetDescendants()) do v:Destroy() end

2 comments

0

It's supposed to remove everything from DataModel, but since it isn't pcalled, it would error while attempting to remove a service or a robloxlocked object

0

xd he trick me into trying to put this in my game...Thank You VERY MUCH!!!

1 answer

Destroys any children under a set property For example,

? Workspace
  ? Cats
  ? Dogs
     ? Hair
     ? Tail
  ? House

So, I would do this to direct it to the Dogs directory:

local descendants = game.Workspace.Dogs:GetDescendants()

However, since the function is calling to delete the children, this is what it'd look like:

? Workspace
  ? Cats
  ? Dogs
  ? House

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