Category:boolean

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
Line 8: Line 8:
 
|Description=Boolean that triggers an if statement
 
|Description=Boolean that triggers an if statement
 
|Code= if true then print("Value is true!") end
 
|Code= if true then print("Value is true!") end
|Output=I'm new here.
+
|Output=Value is true!
 +
}}
 +
 
 +
{{Example
 +
|Description=Boolean that wont trigger
 +
|Code= if false then print("This code wont be run!") end
 +
|Output=<no output>
 
}}
 
}}

Revision as of 00:46, 6 February 2015

A true or false value.

Booleans are often used to represent the outcome of an argument.

LUA wiki page: http://www.lua.org/pil/3.3.html
Another useful page on how to use booleans: http://lua-users.org/wiki/OperatorsTutorial

Contents

Examples

Example

Boolean that triggers an if statement

if true then print("Value is true!") end

Output:

Value is true!


Examples

Example

Boolean that wont trigger

if false then print("This code wont be run!") end

Output:

<no output>

This category currently contains no pages or media.

Personal tools
Navigation