|
| 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 |
|
|
|
| 03 Jan 2013 08:49 AM |
if (Part:FindFirstChild("Script") == nil then --what happens end |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:50 AM |
Whoops forgot a )
if (Part:FindFirstChild("Script") == nil) then --what happens end |
|
|
| Report Abuse |
|
|
| |
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 03 Jan 2013 08:58 AM |
| Or, if(not Instance:FindFirstChild("Name"))then |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:59 AM |
| @1TopCop What does Instance do? |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 03 Jan 2013 09:00 AM |
Instance is an example.
print("Flood checks:",2) |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 11 Jul 2008 |
| Total Posts: 1040 |
|
|
| 03 Jan 2013 09:02 AM |
| Roberto, why are you copying others answers?... |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 09:02 AM |
| Maybe he is making an undelete tool... |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 03 Jan 2013 09:09 AM |
if not workspace:findFirstChild("Part") then print 'Part does not exist.' end |
|
|
| Report Abuse |
|
|