im newbie, and i cannot understand simple problem at my opinion,
my code is pretty simple and short, because i just trying to understand how’s lua working.
i = 1
repeat
i = i + 1
print (i)
wait(0.5)
until i == 2000
print ("variable i, got value 2000, code has been stopped.")
the error is: global ‘wait’ is not callable (a nil value)
and i just cannot understand, how i need to call lua function "wait"
>Solution :
To explain the error message, any name that is not a local variable is considered global. All global variables are nil, unless we assign some other value to them. nil can’t be called like a function can.
Unfortunately, there is no wait function in Lua’s standard library. You can try to find something on luarocks.org that has it. If I understand what you’re trying to do, the function you want is usually called sleep.