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: An effective to clear all children?

Previous Thread :: Next Thread 
vacha is not online. vacha
Joined: 06 Jan 2011
Total Posts: 1993
16 Apr 2015 11:36 PM
Since :ClearAllChildren() uses the deprecated :remove() method is the chunk below the best way to properly destroy all children??

for i,v in ipairs(model:GetChildren()) do
v:Destroy()
end

Report Abuse
vacha is not online. vacha
Joined: 06 Jan 2011
Total Posts: 1993
16 Apr 2015 11:36 PM
Apologies about the title ..
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
16 Apr 2015 11:37 PM
i head ipairs is slightly slower than in pairs or in next

Report Abuse
vacha is not online. vacha
Joined: 06 Jan 2011
Total Posts: 1993
16 Apr 2015 11:38 PM
But ipairs keeps looping till v = nil right? Or is there a better way??
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
16 Apr 2015 11:38 PM
*i heard

gah, floodchecks

and my bad typing skills
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
16 Apr 2015 11:39 PM
and yes, you are correct

ipairs stops when v is nil
Report Abuse
vacha is not online. vacha
Joined: 06 Jan 2011
Total Posts: 1993
16 Apr 2015 11:40 PM
I think the night is slowly creeping into all of our heads..
Report Abuse
vacha is not online. vacha
Joined: 06 Jan 2011
Total Posts: 1993
16 Apr 2015 11:41 PM
Thank you!

a little antecedent action: I was using :ClearAllChildren() and apprantly it uses the remove method which stores the stuffz in memory, that expalins the lag, now imma go fix eet

gud nite
Report Abuse
mycheeze is not online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
16 Apr 2015 11:42 PM
ipairs is still stupid <3

pairs will always be master race

fank u allah 4 the gift of pairs
Report Abuse
vacha is not online. vacha
Joined: 06 Jan 2011
Total Posts: 1993
16 Apr 2015 11:46 PM
ipairs won't miss anything??
Report Abuse
vacha is not online. vacha
Joined: 06 Jan 2011
Total Posts: 1993
16 Apr 2015 11:47 PM
I mean, "Pairs" gash ok now bye
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Apr 2015 11:57 PM
'ipairs is still stupid <3
pairs will always be master race'

Considering they are for different purposes, that's a dumb remark
Report Abuse
mycheeze is not online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
16 Apr 2015 11:58 PM
Considering pairs works similarly as ipairs but is more efficient, your remark is stupid.
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
17 Apr 2015 12:01 AM
it probably should be noted that ipairs is used when the order that you iterate through the table matters

so it has its uses
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Apr 2015 12:03 AM
'Considering pairs works similarly as ipairs but is more efficient, your remark is stupid.'
You obviously have no idea how they work in that case.
Report Abuse
mycheeze is not online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
17 Apr 2015 12:03 AM
mayB 4 reversin chur tables m8

most cases its useless tho
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Apr 2015 12:41 AM
The speed difference across using pairs rather than ipairs is negligible, especially compared to the difference by using a numerical for loop to iterate. So in most cases: both pairs and ipairs are slow and useless.
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