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)