|
| 06 May 2014 03:23 AM |
:remove()
Never use, deprecated, unnessecary lag if used a lot. This accomplishes the same thing as :remove()
brick.Parent = nil
Wiki notes:
Deprecated:This item is deprecated. Do not use it for new work. Use ClearAllChildren to get rid of all child objects, or Destroy to completely destroy this object and its descendants. If you have to remove an object from the game, and you must return it again later, set its Parent property to nil.
This method sets this object's Parent property to nil, then calls Remove on each of the object's children, such that the hierarchy of the object is destroyed. However, the object and its original descendants are still useable, if referenced. Due to confusion with its behavior, Remove has been deprecated and replaced by two other methods. One is Destroy, which performs the intended behavior of removing the object and ensuring that it cannot be used afterwards. The other is ClearAllChildren, which functions in a way similar to Remove, but with a name that better describes its behavior.
:Destroy()
Will get rid of the brick called on, it disconnects ALL events.
Wiki notes:
Sets the Parent property to nil, locks the Parent property, disconnects all connections and calls Destroy() on all children.
:Kick()
Use to get rid of players from a game. Neither of the above will disconnect them. This will.
Wiki notes:
Kicks the player from the game, forcing them to leave. This will actually disconnect the player from the server.
Now, no more arguments. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 03:43 AM |
| Bump to make sure people see this. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 03:48 AM |
| Another way to disconnect a player is to parent there player to nil, then parent it back to players. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 03:50 AM |
| This isn't a question... in other words, I believe this is the wrong forum. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 03:51 AM |
Shame. :(
Any word on why, exactly :remove() causes performance issues and :Destroy() doesn't? |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 03:59 AM |
@Aethar
You're allowed to share your scripts :)
~I'm an Angry Llama~ |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 04:01 AM |
@main
ERRRR Wrong. If you set your players parent to nil your not disconnected, and trying to reps rent it anywhere will error saying that the players parent property is locked. |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 May 2014 04:02 AM |
@Kiwi,
Oh dear me, excuse me, didn't see his one line of script... this is more like telling anyone who actually lurks the forums (mostly knowledgeable scripters) about something we all know. Just somewhat annoys me to read something that really isn't going to get used. But hey, if he wants to waste his time telling us all something we already know, i'm not going to judge. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 04:04 AM |
You don't all know this. Half the people I see on here uses :remove
To name a couple, viper, and KOT |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 04:06 AM |
g = game.Players.MainDirectory g.Parent = nil g.Parent = game.Players
just tested that works fine. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 04:07 AM |
| Oh and by the way, it crashed me. :P e.g. roblox api |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 04:08 AM |
They must have changed it :P
I tested last night and got an error. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 04:09 AM |
| Ah, well it's roblox. What can you expect. lol |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 May 2014 04:12 AM |
| I find this to be good for newer scripters to use as reference, whether it belongs in this forum... not so sure, but I feel as you should put more detail as to why remove will cause lag as to destroy will not, otherwise you leave the "New Scripter" wondering and that's not something that you want for people who are learning. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 04:15 AM |
Is it bad that I never knew Remove() destroyed the hierarchy of an object ... ? :o
It doesn't make lag, but it is less efficient than Destroy() if you don't want to use the object again. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 04:17 AM |
| @Agent o: I never knew it caused lag, I was going by what op said. lol |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 04:17 AM |
@Aether
So if you already know, and dont want to "waste time", there is no need to bother coming to this thread, and posting :P
~I'm an Angry Llama~
|
|
|
| Report Abuse |
|
|
|
| 06 May 2014 04:45 AM |
| If you use remove enough it WILL cause lag, as it is still in the game taking up unnessecary lag. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 05:15 AM |
GC takes care of it as long as you have no references to the object in any scripts. So no, it won't still be in the game after GC is finished with it. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 06:11 AM |
GC?
Remove just parents it to nil, so it is still there. |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 06:17 AM |
| I've actually used collectgarbage() to successfully fix a problem before... |
|
|
| Report Abuse |
|
|
KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
|
| 06 May 2014 06:56 AM |
| Listen to the wise mod boy... |
|
|
| Report Abuse |
|
|
|
| 06 May 2014 07:17 AM |
GC = garbage collector
When something gets parented to nil, and there are no references to it (no variables or properties), it gets deleted from memory automatically by the Garbage Collector. |
|
|
| Report Abuse |
|
|