I want a table like the following:
local Users = {}
local function GetUsers (user)
--cycle through all Users
local Id = GetUserID (user)
local Age = GetAge (user)
local Type = GetType (user)
--Id returns ID of User (value about 8 char length: 27296654)
table.insert (Users, {[Id] = {Age = Age, Type = Type}}
end
This is working as it should but
#Users == 0
if I call Users[Id].Age
it returns correct value.
How to make the #
work?
As I want to cycle trough all Users to check if a User is multiple times in or missing.
They need to be sorted via IDS.
I also thought on transforming the IDs to word with string.char()
As words will be counted as I want it to be.
I want to make it with
for i = 1, #Users do
An example table looks like this:
Users = {
[12345678] = {Age = 18, Type = 1}
[62952766] = {Age = 22, Type = 1}
[23456788] = {Age = 33, Type = 1}
}
So #Users have to be 3 for me but it shows 0. But I can call the Age and type out of the table, that means they are in. Does the table have Problems when the index is such a high number?