|
| 05 Aug 2016 12:47 PM |
game.Workspace.ChatHandler.DescendantAdded:connect(function(Obj) if Obj:IsA("Folder") then for _, Thing in pairs(Obj:GetChildren()) do print(Thing.Name) end end end) I've tried :FindFirstChild and :WaitForChild, neither work.. and this doesn't print, any ways to solve this? Bit confused and frustrated.
ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you! |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 01:25 PM |
Bump
ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you! |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 02:14 PM |
Bump
ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you! |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:16 PM |
Am I missing something? Not enough info? Someone?
ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you! |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:16 PM |
obj:GetChildren() == array of children == {child,child,child..}
for _,v in pairs(obj:getChildren()) do --v is a child end
if you know this then that is not what you did wrong. |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:19 PM |
Uh? It doesn't do anything... I thought you could just do :FindFirstChild.. but that doesn't even work..
ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you! |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:22 PM |
| Maybe try using ChildAdded on where the folders will be |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:27 PM |
The objects I'm trying to access are already in the folder when it's added though.
ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you! |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:30 PM |
Not what I meant -.-
folderLocation.ChildAdded:connect(function(folder)
end)
You can literally also just make another folder or a model where all folders will go |
|
|
| Report Abuse |
|
|
Noveric
|
  |
| Joined: 04 Aug 2016 |
| Total Posts: 432 |
|
|
| 05 Aug 2016 03:32 PM |
This will work fine - it's an issue with the folder.
|
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:33 PM |
You're confusing me though.. that's what DescendantAdded does.. I'm trying to keep this compact, not spread about in 4 different folders, that creates clutter and complicates things. That should work, but nothing happens.
ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you! |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:34 PM |
| ^ It is much easier to keep all messages organized in 1 folder than to see which child is a folder |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:35 PM |
But it's like 2 lines of code to see if it's a folder that's being added.. I'm trying to keep 4 values together, not spread apart.
ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you! |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:37 PM |
function FolderAdded(f)
end
script.Parent.ChatFolders.ChildAdded:connect(FolderAdded)
--much easier --also before parenting the folder to it you need to fill it |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:38 PM |
Oh my god, that was my problem.. don't know how I didn't find that myself, thanks.. even though I sound like a smart ass...
ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you! |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:39 PM |
If you do
local f = Instance.new("Folder",chatstuff)
then it will read the empty folder |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 05 Aug 2016 04:18 PM |
workspace.ChatHandler.ChildAdded:connect(function(child) if child:IsA('Folder') then for i,v in next, child:GetChildren() do print(v.Name) end end end)
|
|
|
| Report Abuse |
|
|