So when you go like data = table2['BB Gun'] the value for the variable data becomes {lvlRequirement=0} and when you go print(table1[data]) its looking for INDEXES that are called {lvlRequirement=0} and returns nil because there are none..
To get ahtw you're looking for you have to use a for loop to iterate over all values and return the index, example
for index,value in pairs(table) do
if value == 'Blah blah lbha la' then
return index --This returns the index if the value is 'Blah blah blah bla'
end
end
k |