Jump to content

isNil?


dugasz1

Recommended Posts

Hello!

How can i detect if a array's member exist or not?

  
local array = { 
    {"wathever", "wathever"}, 
    {"wathever", "wathever"}, 
    {"wathever", "wathever"}, 
} 
if(array[4] == nil) then  
    --Do Something 
end 

Beacause this doesn't work. It throws attempt to index field error.

Edit:

I know i can count the table's lenght and check it but i want detect if

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...