I'm in the middle of creating a system that exports a table of data from an array of StringValues
, but for some reason it isn't running at all. I've done some tests, and it appears that the GetChildren()
method always returns no children when I use it on the specific object. Here is my code:
local module={} function module.getQueue() local t={} --initialize table for i=1,#script.Parent.Queue:GetChildren() do --begin loop. Always runs for 0 iterations table.insert(t,script.Parent.Queue[tostring(i)].Value) -add something to the table. This is never executed. end return t --export table end return module
Both the module and the Queue object are located within a folder, if that helps.
If you can help, please do! Thank you!
Your loop seems bit wonky. This should work better:
local module={} function module.getQueue() local children = script.Parent.Queue:GetChildren() local t={} for i=1, #children do table.insert(t, children[i].Value) end return t --export table end return module