Help with getting objects and storing them?
Hello all. I am wondering how to get the first 10 objects in a folder, based on their names. The objects names are Item1, Item2, Item3, and so on. This is my code so far, but when I try to index the item with item.Name it gives me an error of
Attempt to index local "item" (a nil value).
Why is the value nil? Please help.
1 | local function loadPage(gui) |
2 | local Items = gui.GUI.Items |
5 | print ( "Item" .. tostring (i)) |
6 | local item = Items:FindFirstChild( "Item" .. tostring (i)) |
7 | table.insert(first 10 , item.Name) |
If more info is needed please leave a comment