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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Will puting removed items in debris reduce servercrashes?

Previous Thread :: Next Thread 
tyleralex123 is not online. tyleralex123
Joined: 01 Apr 2009
Total Posts: 19934
26 Jan 2014 02:27 PM
So instead of saying

game.Workspace.Brick:Remove()

I'd say

game.Workspace.Brick.Parent = game.Debris
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
26 Jan 2014 02:28 PM
no
say
workspace.Brick:Destroy()
Report Abuse
DaMrNelson is not online. DaMrNelson
Joined: 27 Jul 2009
Total Posts: 4405
26 Jan 2014 02:28 PM
That will only make your game laggier and take up more RAM, as the parts still exist in debris. Use this instead:

game.Workspace.Brick:Destroy()

Destroy locks the part's Parent as nil, closes any connections (as in .Touched, .Changed, etc.), and basically primes it for garbagecollection (what ROBLOX uses to take things that are not being referenced anymore out of the game's memory).

Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson
Report Abuse
tyleralex123 is not online. tyleralex123
Joined: 01 Apr 2009
Total Posts: 19934
26 Jan 2014 02:45 PM
Now if destroy primes it for garbagecollecion, what does remove do?
Report Abuse
DaMrNelson is not online. DaMrNelson
Joined: 27 Jul 2009
Total Posts: 4405
26 Jan 2014 02:51 PM
Remove is simply not as efficient. It does not lock the Parent property, or disconnect connections. If I'm correct, the connections will stop the Part from being collected. However, don't quote me on that.

Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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