|
| 26 Dec 2015 12:35 PM |
It would be much easier if roblox added a :HasChild(). What it does? Simple. It searches for a specific item. Like FindFirstChild() except. You can do if script.Parent:HasChild("BoolValue") then --Do something. else --Do something end |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 12:36 PM |
Nope. You can use FindFirstChild().
if script.Parent:FindFirstChild("BoolValue") then --Do Something. else --Do Something. end
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
Vultorz
|
  |
| Joined: 02 Mar 2015 |
| Total Posts: 2985 |
|
|
| 26 Dec 2015 12:36 PM |
AHEM if script.Parent:FindFirstChild("BoolValue") = true then AHEM |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 12:37 PM |
for_,v in pairs(obj:GetChildren()) do if obj:IsA('') then end end |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 26 Dec 2015 12:38 PM |
or:
if child:IsDescentantOf(parent) then end
-syntax
|
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:10 PM |
No but for consistency we should have
FindFirstPlayer (Players) WaitForPlayer (Players) GetDescendants WaitForDescendant
|
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:12 PM |
| @war And, please let us use Color3 on VertexColor instead of Vector3 |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:14 PM |
SO TRUE
And given how everything is capitalizaed
Player.UserId Game (undeprecate and deprecate game) Workspace (undeprecate and deprecate game) Script
|
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:15 PM |
"AHEM if script.Parent:FindFirstChild("BoolValue") = true then AHEM"
uhhhhhhhh missing two equals signs, == true is not necessary, and no end |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:16 PM |
| @Chief You forgot the noticeably missing .Value, and even then, what if the child don't exist, you're indexing nil. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:18 PM |
| actually i just thought he was using == true to check if the object existed |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:19 PM |
| If that's the case it won't work anyway. An object will never be equivalent to a boolean. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:20 PM |
| no but FindFirstChild would return true so it would == true |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:30 PM |
| No, FindFirstChild would return the child, not if it found it or not. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 01:40 PM |
| oh crap what am i even saying lmao sorry |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Dec 2015 07:47 PM |
It would be nice to have more than just findfirstchild() plus, the WaitForPlayer() is a brilliant idea. But it would be cool if we could just have it as a setting. like:
WaitForPlayer [ ] --Script operates when player is fully loaded Transparency [ ] Position [ ]
You get it. |
|
|
| Report Abuse |
|
|