FindFirstChild (Function): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Mr Doom Bringer
m Reverted edit of Travisdep, changed back to last version by Mr Doom Bringer
>ArceusInator
redirect
 
(38 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Function|
#REDIRECT [[FindFirstChild (Method)]]
name                  = FindFirstChild
|arguments            = [[String]] Name, [[Bool]] recursive
|returns              = [[Instance]] ''found object''
|description          = Returns the first child found with a name of ''Name''. Returns ''nil'' if no such child exists.
|object              = Global
|}}
 
 
==Example==
<pre>
 
function OnTouched(hit)
brick = hit.Parent:FindFirstChild("Torso")
if (brick ~= nil) then
  brick.BrickColor = BrickColor.new(1)
end
end
 
script.Parent.Touched:connect(OnTouched)
 
</pre>

Latest revision as of 16:38, 11 January 2011