61 posts / categories / feed
Creating and Accessing Table with For Loops Note when working with pairs and associative indexes, the order is unpredictable, hence you will have to write some logic to put it in order yourself. You can use “ipairs” to access the table.
Conditional Statement in Lua This is pretty similar to the majority of the languages. Conditional Statement with String Conditional Statement with Numeric
Creating Functions in Lua It is easier to create functions in Lua for reuse. One thing to note is that, usually for creating functions, we use to add function name(param) { }, but in Lua, do not add the parentheses, otherwise it will cause an error. Creating Basic Function Creating Function with Parameters There is […]
Creating and Using Tables In Lua, it is optimized to use Tables which in other languages they are better known as “Arrays”. Create a Table Special note that in Lua, unlike the general idea of accessing Arrays where the first index starts from index 0, Lua starts from 1. Hence to access the first item […]
Getting and setting variables in Lua Note that “;” is not required in Lua, hence regardless of adding it or not, does not really matter much. Creating a Global Variable   Creating a Local Variable   Concatenation Concatenation in Lua is done with the use of “..”, while some other languages such as PHP is […]