I was wondering why is line 12 printing "nil" when I do line 13 it prints there name,why and how do I fix it?
Items = {"Bob","Tod","Josh"}
function ChangedParts()
ChangedItems = {}
for i,v in pairs (Items) do
local Part = Instance.new("Part",workspace)
Part.Name = "New"..tostring(v)
ChangedItems[v] = Part
end
return ChangedItems
end
Parts = ChangedParts()
print(Parts[1])--nil?
for i,v in pairs (Parts) do
print(v)
end

2 comments
In short, you saved the new part as "Bob", "Tod", and "Josh". You are looking for "1". That's why it's nill.
I only did this way because I heard it's the easiest way to store single instances :p