Lua: Decisions


Lua supports IF statements and Nested IF statements to perform decisions.


Example: If statement in Lua


	x = 10
	if x == 10 then
		print("Correct")
	end
	

Output:

  Correct


Example: If-elseif-else statement in Lua


	x = 10
	if x > 10 then
		print("Large")
	elseif x > 20 then
			print("Larger")
	else
		print("Smaller")
	end
	

Output:

  Smaller