see Section 4.7. name Its only parameter is used to specify the name of the file it should execute the contents of; if no argument is given, it will execute the contents of the standard input. assignment, control structures and procedure calls. If both the operands are non zero then condition becomes true. You should convert your string to a number, if you know for sure that it should be a number, and if there is no reason for it to be a string. The world is full of ifs and but a so why it wouldnt be present in the programming world. A faster way is to code a single if/then statement, and use the keyword elseif to provide alternative conditions to test for if the first one in isn't true. It ends with the end keyword: When a scope ends, all the variables in it are gotten rid of. The do statement is a statement that has no other purpose than to create a new block of code, and therefore a new scope. Since you've tested that finishRace() works, remove the test print statement to keep the script clean. print("Rahul is elder than Ankush" ) end Agenew = 20*5 Variables Lua is a loosely-typed programming language. The if statement can contain logical and arithmetic operators. print("Voila!, you are not born :P" ) In Lua, this code will raise an error, so it is necessary to write the previous example like this: Parallel assignment, which is also called simultaneous assignment and multiple assignment, is a type of assignment that simultaneously assigns different values (they can also be the same value) to different variables. To finish, you'll use an if statement with multiple conditions that will award a different prize medal to players based off their performance. The conventional commands include assignment, control structures and procedure calls. This means when the APICAST_SERVICE_%s_CONFIGURATION_VERSION env var is set we should use the old logic and endpoints because we need to retrieve each service's . By using this website, you agree with our Cookies Policy. if( Age == 0 ) ComputerCraft Lua 1-4 Fundamentals Conditional Statements, Lua 5.2 Tutorial 3: Logic Statements and Conditionals. This is why it is generally safer when working with decimal numbers to avoid using the equality operator. A loop is a sequence of statements which is specified once but which may be carried out several times in succession.