Jump to content

Count Table


Recommended Posts

Hi guys. Im work on the party system.

local test = { 
    test2 = { 
        ["userdata: 46f6s68"] = { 
            leader = "ZoRRoM^", 
            member = {} 
        ["userdata: 54fghd9"] = { 
            leader = "Narkoz", 
            member = {} 

Im try it for the get count table. But it's not work.

It's have 2 count. But #test.test2 say's 0.

How to fix it?

Link to comment
  • Moderators
local tableRange = 0 
for key,data in pairs(test.test2) do 
    tableRange =    tableRange+1 

Tables without using the array can't use #.

If this table had an array it would only have numbers as index.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...