So I know in a table
Table = {ScriptingHelperAdminsAreSoBad = 'I Know Right', DevForumAdminsAreBetter = 'Yes'} -- You can just do print(Table.DevForumAdminsAreBetter) --or print(Table['DevForumAdminsAreBetter'])
But what if I had a table array like this
local Tab = {'G','F','G','E','C','T',"T",'G','I','F',"F",'R','GucciGang',"I",'D','A','Y'}
How would I print GucciGang right away since I cant just do
Tab.GucciGang since there is no key
Here, the index position would actually be just sequential numbers, but if you don't want to use in pairs, you could do this:
local Tab = {'G','F','G','E','C','T',"T",'G','I','F',"F",'R','GucciGang',"I",'D','A','Y'} for index = 1, #Tab do if Tab[index] == "GucciGang" then print(index, "GucciGang") end
You can't find a table entry with a specific value without iteration, iirc.