Numbers

A number represents a numeric value.

local health = 100
local damage = 12.5
local result = health - damage

print(result) // 87.5

Numbers can be integers or decimal values.

local whole = 42
local decimal = 3.14

They are commonly used with arithmetic and comparison operators.

local a = 10
local b = 5

print(a + b) // 15
print(a * b) // 50
print(a > b) // true

For more advanced number behavior, see the Operators page.

Categories:

Updated: