0 Members and 1 Guest are viewing this topic.
function inTable(tbl, item) for key, value in pairs(tbl) do if value == item then return key end end return falseendtbl = {"a", "b", 2, 1, 1337}print(inTable(tbl, "b")) -- Print's 3 (the position of "2")print(inTable(tbl, "theGame")) -- Falseprint(inTable(tbl, 1337)) -- 5