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: Not Finding Children

Previous Thread :: Next Thread 
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
11 Jan 2015 09:42 PM
My script isn't finding any of the children. It never displays does not meet standards and it always prints 0. I'm new to for statements, and am trying to learn. Thanks for your patients.

script.Parent.MouseButton1Down:connect(function()
a = 0
function Index(i)
for i,v in pairs(script.Parent.Parent:GetChildren()) do
if v.Name == "NewDocument" or v.Name == "BlankSheet" then
print("Does not meet Standards")
else
a = a+1
end
end
end
print(a)
end)
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
11 Jan 2015 09:43 PM
You never called the function!

script.Parent.MouseButton1Down:connect(function()
a = 0
for i,v in pairs(script.Parent.Parent:GetChildren()) do
if v.Name == "NewDocument" or v.Name == "BlankSheet" then
print("Does not meet Standards")
else
a = a+1
end
end
print(a)
end)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
11 Jan 2015 09:43 PM
You never called the Index function, and creating a function every time the event is triggered is very inefficient :)
Report Abuse
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
11 Jan 2015 09:46 PM
Oh my heck. Thanks for pointing that out.
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