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: How to load frames/folders etc

Previous Thread :: Next Thread 
Zorbon61 is not online. Zorbon61
Joined: 05 Jun 2012
Total Posts: 321
06 Feb 2015 11:40 PM
Can't remember the proper term for em, so I'll just say frames/folders. How would I load all the children in a gui? I want the folders, and values in the folders to load before I pass an if statement, otherwise it won't find it. I know wait() could work, but is there something to tell the script it's there, then continue to find the next child?
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
06 Feb 2015 11:41 PM
:WaitForChild ()
i think
Report Abuse
Zorbon61 is not online. Zorbon61
Joined: 05 Jun 2012
Total Posts: 321
06 Feb 2015 11:42 PM
would I have to use that in a for loop?
Example;
for i, v in pairs(Frame:GetChildren()) do
v:WaitForChild()
end


Something like that?
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
06 Feb 2015 11:43 PM
no, but nice way of doing that

for i,v in pairs (Frame:GetChildren ()) do
Frame:WaitForChild (v)
end
Report Abuse
Zorbon61 is not online. Zorbon61
Joined: 05 Jun 2012
Total Posts: 321
06 Feb 2015 11:44 PM
Alright thanks, will experiment
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
06 Feb 2015 11:44 PM
'for i,v in pairs (Frame:GetChildren ()) do
Frame:WaitForChild (v)
end'


It would be Frame:WaitForChild(v.Name)

But that wouldn't work because if it is captured in :GetChildren() it already exist so it doesn't need to be waited for
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
06 Feb 2015 11:46 PM
oh wow, you're right
I'm not thinking so much today
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
06 Feb 2015 11:47 PM
If you already know the names of all the children you could do this though

local children = {
"frame";
"anotherFrame";
"textButton";
}

for _, child in next, children do
frame:WaitForChild(child)
end



Assuming nothing in the gui is named the same thing this will work
And you shouldn't have anything named the same thing in something so
Report Abuse
Zorbon61 is not online. Zorbon61
Joined: 05 Jun 2012
Total Posts: 321
06 Feb 2015 11:50 PM
Oooo. Thanks a bunch man!
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