I am starting to work on an installer plugin which would allow you to install any compatible game kit in to your game (using asset id's). But anyway I want to add a way for developers to add optional parts to the installation (I.e. points, developer products, and the like), and the only way I can tell what is available to install, is by knowing the children of my optional folder, by use of a table, and I need to know if this is possible using :GetChildren.
The product of :GetChildren() IS a table. If you put
print(workspace["Model"]:GetChildren())
in the command line, for example, it'll return "table: " followed by a serial number for the table.
If you want to utilize the table in some way, there are various ways you can check. Here's a couple of examples:
for i,v in pairs(script:GetChildren()) do if v ~= nil then return v end end
local children = script:GetChildren() for a=1,#children do if children[a] ~= nil then return children[a] end end
Either example, when used, will get the script's children, determine if the child is nil, and, if it isn't, return the child. Useless in actual scripting, of course, but it makes a decent example.