generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: disclude a single specific object from a table

Previous Thread :: Next Thread 
Intern33t is not online. Intern33t
Joined: 19 Nov 2010
Total Posts: 1530
17 Apr 2015 09:40 AM
explorer:

game
-workspace ("Service")
--TemporalStorage ("Folder")
---TemporalStorageMaintain ("Script")
---Part ("Part")
---basically random junk (:Clone()'d "Part"s)
-other services ("Service")

script:

script.Parent:GetChildren():Destroy()


but how do i make it destroy everything BUT itself?
Report Abuse
SeizureMadness is not online. SeizureMadness
Joined: 23 Apr 2011
Total Posts: 154
17 Apr 2015 09:43 AM
thingthathastobecleaned = game.Workspace.TemporalStorage

for i, v in pairs(thingthathastobecleand:GetChildren()) do
if v.ClassName ~= "Script" then -- leaves the script untouched
v:Destroy()
end
end

I guess with in pairs. You can also use 'next' or something.
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
17 Apr 2015 09:43 AM
Check if it's itself...
Report Abuse
Intern33t is not online. Intern33t
Joined: 19 Nov 2010
Total Posts: 1530
17 Apr 2015 09:46 AM
@seizure

There will probably also be scripts in the tempralstorage that have to be cleared. Is using "if v ~= script then v:Destroy() end" okay?
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
17 Apr 2015 09:48 AM
if v ~= script then


Wouldn't that work? Cause it checks if the Script is itself
Report Abuse
SeizureMadness is not online. SeizureMadness
Joined: 23 Apr 2011
Total Posts: 154
17 Apr 2015 09:54 AM
If you want to destroy the script too then just remove the if statement (also the end). Now all children are destroyed.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image