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 » Scripting Helpers
Home Search
 

Re: Five Ways To Remove?

Previous Thread :: Next Thread 
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 12:59 PM
workspace.Part.Parent = nil, workspace.Part:remove(), workspace.Part:Destroy(), Derbis, workspace.Part = nil

(Also if there is more ways, Can someone tell me?)

Can someone explain each one?

I know
workspace.Part.Parent = nil
Makes it not have a parent...So would this work?

Brick = workspace.Part
while true do
wait(0.03)
Brick.Parent = nil
wait(0.03)
Brick.Parent = workspace
end

And remove(), I cant tell. As far as I know its the same as Destroy() (But everyone says Destroy() is better so I always use it)

For Destroy() I dont see why not just use remove()

And I know almost nothing about Derbis but it deletes bricks or something?

workspace.Part = nil makes the part nil, Meaning nothing, Right?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
17 Nov 2012 01:02 PM
remove() is the same as Parent=nil
Destroy() sets it to nil and Locks it, Reducing Lag.
Report Abuse
Toby12600 is not online. Toby12600
Joined: 01 Mar 2011
Total Posts: 193
17 Nov 2012 01:04 PM
Here is a remove thingy to kick somebody :P
game.Workspace.(Player):Remove()
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 01:07 PM
@Toby
game.Players.(Player):Destroy()
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 01:23 PM
Bump
I wanna know about all of them.
And whats best for removing a part you want gone forever?
Report Abuse
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
17 Nov 2012 01:26 PM
game.Workspace["Part"]:remove()
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
17 Nov 2012 01:26 PM
game.Debris:AddItem(Part,5 --[[ Removes after 5 seconds, best for local scripts ]]
Part:Destroy() --[[ Removes the part instantly, and removes all connections and events associated with it. ]]
Part:Remove() -- Makes it's parent nil
Part.Parent = nil -- I prefer just Part:Remove()
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 01:29 PM
@1Topcop
game.Debris:AddItem(Part,5

Why not just say
wait(5)
workspace.Part:remove()
?
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
17 Nov 2012 01:31 PM
:Destroy() is what you use if you never ever ever ever want the object again.

x.Parent = nil is what you use if you don't want the part to be gone forever.
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
17 Nov 2012 01:33 PM
Because AddItem creates a coroutine and will work even after the script is gone.
Crazyman32 pointed out the other day (which I already knew) that if a player leaves and is using a LocalScript, if he had a wait(Time) then Part:Remove() the part would never remove, because it was waiting when it got destroyed.
With the AddItem method, it will remove even when the script is no longer existent.
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 01:33 PM
@Free
So this would work?
Brick = workspace.Part
while true do
wait(0.03)
Brick.Parent = nil
wait(0.03)
Brick.Parent = workspace
end


And do scripts with a parent of "nil" run? (I would guess not, But Im still asking)
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
17 Nov 2012 01:36 PM
If they start out in workspace, then yes.

script.Parent = nil
for n=1,5 do
wait(1)
print("I'm still running even after "..n.." seconds!")
end
print("And I will always run *_*")


Also good to know, wait() waits the shortest amount of time possible (which is normally .03 seconds)
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 01:37 PM
@1Topcop
I was told you could change the wait() in your studio settings causing some scripts to wait longer, And break

So I just use wait(0.03)
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
17 Nov 2012 01:38 PM
Well it would only be effective on LocalScripts, and if anyone messes with it, they get what they deserve. x3
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