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: .Parent = nil same thing as :Destroy()

Previous Thread :: Next Thread 
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
12 Apr 2015 09:47 AM
I'm wondering because if parenting to nil takes up ram I'll have to change my whole code. Does this effect anything?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
12 Apr 2015 09:48 AM
Yes. Destroy is more efficient. If you were going to parent it to nil to remove it, just use :Remove(). But that is deprecated, and Destroy should be used instead.

By the way, just use find and replace.
Report Abuse
Cuyler is not online. Cuyler
Joined: 27 Feb 2006
Total Posts: 3784
12 Apr 2015 09:48 AM
Parenting to nil does not add it to the Garbage Collection table.

If you want to replace all your .Parent = nil then you can press ctrl + H in Studio and fill in the Replace and Replace With boxes, then click "Replace All."
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
12 Apr 2015 09:49 AM
Or if you use find and replace on any decent text editor, you can also use regular expressions.
Report Abuse
VanillaPolarBear is not online. VanillaPolarBear
Joined: 22 Oct 2009
Total Posts: 1987
12 Apr 2015 09:49 AM
I'm pretty sure you can still recover something that is in nil so it will still be there, just not physically, putting something in nil doesn't delete it unlike :Destroy()
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
12 Apr 2015 09:57 AM
Ugh my code is a mess. I made it when I was really tired so it's all just messed up, and find and replace wouldn't help me. It's the actual functioning of the script xd
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
12 Apr 2015 10:18 AM
Yeah you should only parent it to nil if you want to take it back out at a later time.


I script -~ chimmihc
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