04-02-2011, 11:12 PM
[lua]p = Instance.new("Part") -- Create a new brick
p.Parent = game.Workspace -- The part (a grey brick, by default) has a parent, the workspace
wait(1)
p.Parent = nil -- The part now has no parent (and so it disappears from view, but not from memory).
wait(1)
p.Parent = game.Workspace -- part still exists because it is referenced by the variable 'p'
wait(1)
p.Parent = nil -- part disappears again (it has no parent)
p = nil -- part is no longer referenced by anything, so it gets picked up by the garbagecollector
[/lua]
LEGIT BRO
p.Parent = game.Workspace -- The part (a grey brick, by default) has a parent, the workspace
wait(1)
p.Parent = nil -- The part now has no parent (and so it disappears from view, but not from memory).
wait(1)
p.Parent = game.Workspace -- part still exists because it is referenced by the variable 'p'
wait(1)
p.Parent = nil -- part disappears again (it has no parent)
p = nil -- part is no longer referenced by anything, so it gets picked up by the garbagecollector
[/lua]
LEGIT BRO
(Oversized sig image removed)


![[Image: 76561197975251923.png]](http://badges.steamprofile.com/profile/default/steam/76561197975251923.png)
![[Image: n54lfl.jpg]](http://oi53.tinypic.com/n54lfl.jpg)
![[Image: k1ouq9.jpg]](http://oi55.tinypic.com/k1ouq9.jpg)