Referencing to an item with index in workspace

i have a folder in workspace that has children of different names like a block that’s named A and a boolvalue that’s named B

how do I reference to them with indexes? I’ve tried


but it seems to be finding an object named 1 in the folder which of course doesn’t exist and errors

did you :GetChildren() of the folder?

local letter = "B"
local child = folder[letter]

Are you asking for something like this?

No, he wants to local something in the folder by the position of it[1,2,3,4]

1 Like

I think they want it to either:

  • Reference in alphabetical order


  • Just do :GetChildren()[1]
1 Like

What’s your explorer?
Here’s an example.

local folderindex = {
{A = "sword" }
{B = "shield" }

for _, index  in pairs(folderIndex) do

something like this?

sorry for creating all of this it was a really stupid mistake
I had to use GetChildren() sorry!