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
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
| |
|
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
|
  |
| 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
|
  |
| Joined: 05 Jun 2012 |
| Total Posts: 321 |
|
|
| 06 Feb 2015 11:44 PM |
| Alright thanks, will experiment |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 05 Jun 2012 |
| Total Posts: 321 |
|
| |
|