Remove (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy
added/changed/formatted
>NXTBoy
Float clear, category
Line 1: Line 1:
{|
<onlyinclude>{{Method
|<onlyinclude>{{Method|name = Remove
|name = Remove
|arguments  =  
|arguments  =
|returns = [[nil]]
|description = Sets the Parent property to [[nil]] and calls Remove() on all children.
|description = Sets the Parent property to [[nil]] and calls Remove() on all children.
|object = [[Instance]]
|object = [[Instance]]
|}}</onlyinclude>
}}</onlyinclude>
|}
{{clear floats}}
 
{{Example|<pre>
{{Example|<pre>
function onTouched(hit)
function onTouched(hit)
Line 15: Line 13:
script.Parent.Touched:connect(onTouched)
script.Parent.Touched:connect(onTouched)
</pre>}}
</pre>}}
[[Category:Methods]]

Revision as of 15:23, 30 August 2010

Remove( )
Returns nil
Description: Sets the Parent property to nil and calls Remove() on all children.
Member of: [[RBX.lua.Instance (Object)|Instance]]
Example
function onTouched(hit)
  hit:Remove()
end

script.Parent.Touched:connect(onTouched)