generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Should'nt Roblox make :HasChild() ?

Previous Thread :: Next Thread 
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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 is not online. 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
ACDEVTEAM6 is not online. ACDEVTEAM6
Joined: 27 Mar 2015
Total Posts: 20
26 Dec 2015 12:37 PM
for_,v in pairs(obj:GetChildren()) do
if obj:IsA('') then
end
end
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
26 Dec 2015 12:38 PM
or:

if child:IsDescentantOf(parent) then
end

-syntax
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
26 Dec 2015 01:10 PM
No but for consistency we should have

FindFirstPlayer (Players)
WaitForPlayer (Players)
GetDescendants
WaitForDescendant
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
26 Dec 2015 01:12 PM
@war And, please let us use Color3 on VertexColor instead of Vector3
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
ChiefTitan is not online. ChiefTitan
Joined: 03 Dec 2015
Total Posts: 2242
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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
ChiefTitan is not online. ChiefTitan
Joined: 03 Dec 2015
Total Posts: 2242
26 Dec 2015 01:18 PM
actually i just thought he was using == true to check if the object existed
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
ChiefTitan is not online. ChiefTitan
Joined: 03 Dec 2015
Total Posts: 2242
26 Dec 2015 01:20 PM
no but FindFirstChild would return true so it would == true
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
26 Dec 2015 01:30 PM
No, FindFirstChild would return the child, not if it found it or not.
Report Abuse
ChiefTitan is not online. ChiefTitan
Joined: 03 Dec 2015
Total Posts: 2242
26 Dec 2015 01:40 PM
oh crap what am i even saying lmao sorry
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
26 Dec 2015 01:42 PM
XD it's fine
Report Abuse
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image