Value Types

Lua variables can contain one type of value.

Data Type

Description

Example

Data Type

Description

Example

nil

A value with no data (null not 0). A variable without an assigned value is nil by default.

local x local x = nil

boolean

Either true or false.

local x = true

number

Any number, including fractional or negative numbers.

local x = 103.9

string

A string of text or characters. See Strings

table

See Lua Tables.

function

See Functions.

userdata

See User data type

 

In the Translator, you can use type() to see the variable value:

Â