local / variable
Try it yourself →Stores a value.
Syntax
local name = value
Description
local defines a local variable (recommended). Variables defined without local become GLOBAL. No type is specified.
Example
local name = "Alex" local age = 36 print(name, age)
Expected output
Alex 36
When to use?
Storing all kinds of data.
Common mistakes
- ⚠️ Forgetting local makes the variable global — always use local if possible.