Jump to content

Tables


Drakath

Recommended Posts

I'm trying to index some stuff but I can't get it to work.

I have a text which is assigned to a player. I want to check if this text is assigned. (I do not want to use account data)

There can be many different texts.

Here's what I tried:

if pText[player] then 
        table.insert(pText[player], {[text] = "someValue"}) 
    else 
        pText[player] = {[text] = "someValue") } 
end 
--I check if it is assigned like this: 
if pText[player][text] then 
doStuff() 
end 

The first text works but when it tries to assign the second text and uses table.insert, my script doesn't detect it anymore.

Can anyone help me fix this?

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