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 » Scripting Helpers
Home Search
 

Re: FindFirstChild if something isn't found

Previous Thread :: Next Thread 
UndeleteTool is not online. UndeleteTool
Joined: 15 Mar 2012
Total Posts: 1851
03 Jan 2013 08:48 AM
If findfirstchild is used and something isn't found, then what would I say in a script to get something to happen?

Part:FindFirstChild("Script")
--if not found
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
03 Jan 2013 08:49 AM
if (Part:FindFirstChild("Script") == nil then
--what happens
end
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
03 Jan 2013 08:50 AM
Whoops forgot a )

if (Part:FindFirstChild("Script") == nil) then
--what happens
end
Report Abuse
UndeleteTool is not online. UndeleteTool
Joined: 15 Mar 2012
Total Posts: 1851
03 Jan 2013 08:51 AM
Thanks
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
03 Jan 2013 08:58 AM
Or, if(not Instance:FindFirstChild("Name"))then
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
03 Jan 2013 08:59 AM
@1TopCop What does Instance do?
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
03 Jan 2013 09:00 AM
Instance is an example.

print("Flood checks:",2)
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
03 Jan 2013 09:01 AM
Just say:

if Part:FindFirstChild("Script")==nil then
--Not found
end

Or you can say:

if not Part:FindFirstChild("Script")then
--Not found
end
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
03 Jan 2013 09:01 AM
If you don't mind me asking, what are you making? By all the questions I see by you, you seem pretty inquisitive. I am interested in knowing what you are making.
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
03 Jan 2013 09:02 AM
Roberto, why are you copying others answers?...
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
03 Jan 2013 09:02 AM
Maybe he is making an undelete tool...
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
03 Jan 2013 09:03 AM
Lol =P

Also, re-reading what I said, I sounded cocky, so my apologies.
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
03 Jan 2013 09:04 AM
It was not intentional, When I got to this post, no one had posted yet and I went AFK, when I got back I finished posting, and apparently it was already answered. Thanks for noticing though that both the answers I gave were answered already.
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
03 Jan 2013 09:09 AM
if not workspace:findFirstChild("Part") then
print 'Part does not exist.'
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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