Posted 04 October 2013 - 10:48 AM
Hi i have a problem this is my code so far:
basically what i want to do is: search if a user is in the username table and then check at what specific location he is at. for example i check if user1 is in the table and then i want to know he is the first one in the table. how do i do that?
local user = "user1"
local uTable = {
[1] = "user1",
[2] = "user2",
}
for k, v in pairs(uTable) do
if user == uTable[v] then
print(k)
break
end
end
basically what i want to do is: search if a user is in the username table and then check at what specific location he is at. for example i check if user1 is in the table and then i want to know he is the first one in the table. how do i do that?