Jump to content
  • 0

How to fix


SlenderNonr

Question

4 answers to this question

Recommended Posts

Posted

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.

Posted

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

Archived

This topic is now archived and is closed to further replies.

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