LUA annotation syntax, lua Annotation
The server code has been completed, the client is being optimized, and the game will be launched soon. Nothing has been done recently. The boss asked me to start learning the project Anarchy. The code in it is a preferred C ++, including lua, I haven't learned lua yet. I read the LUA code, which is similar to Delphi,
The following is a comment:
Single line comment: "--" is used to comment on the characters after the comment, similar to the C language comment after the ISO C90 "//"
Multi-line comment: Use "-- [" "]" to comment, similar to the C language "/*""*/".
LUA basic syntax
In lua
{} Is similar to an array in c.
Indicates that the table {1, 2} is assigned to C.
1 and 2 are not independent, but are assigned to a in the form of a table.
If
A = 3
Print (a) outputs 3
Now
A = {7, 8}
Print (a [1]) will output 1
Print (a [2]) will output 2
Understand.
LUA syntax
It means that you have compared the number with the nil value, and naturally get an error.
In addition, I have run the code you posted, so there is no problem.