slots = script.Parent.Frame.Control:GetChildren()
--gui clickage--
for i,v in pairs(slots) do
if tonumber(v.Name) then
v.MouseButton1Click:connect(function()
v.Visible = false
local numClicked = v.Name
print(numClicked)--prints one
print(selected[1])--prints namey namey(expected to)
print(selected[numClicked])--prints nil
end
end
end)
It's not really an error in the output, but it has been proven by prints that it should not print nil at all.
btw Selected is a table that has one thing in it, a string called namey namey.
So yes, I think this is quite the odd error, as ithas been printificaciously proven, that this should not print nil.

3 comments
could it be that you're trying to print the first index value of selected within the slots index? like selected is a different table but you're trying to tell it to print the first value of the selected table but you're saying that while in the slots table. does that make sense or am I just talking crazy? haha
Red line 7 local numClicked = v.Name
Did that answer the question?