Jump to content
  • 0

How to fix


SlenderNonr
 Share

Question

4 answers to this question

Recommended Posts

  • 0

Hi @SlenderNonr, send us the script. I believe you're trying to enumerate table on a global variable named "dragostand". Roughly like this:

dragostand = {1,2,3,4}

If so, you can enumerate it like this:

# Enumerate key & value
for key, value in ipairs(dragostand) do ...

# Enumerate key
for key in pairs(dragostand) do ...

We're not wizard. We need context or the source of the problem.

Link to comment
Share on other sites

  • 0

Another typical mistake that causes such error is wrong usage of returned value of "gg.choice" (or "gg.alert") function. Example of wrong and correct usage: 

local choice = gg.choice({"Option 1", "Option 2"})

-- Wrong usage, returned value is a number, not table
if choice[1] == 1 then
  print("Option 1 has been chosen")
end

-- Correct usage
if choice == 1 then
  print("Option 1 has been chosen")
end
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.