๐Ÿ”น VARIABLES (local)

Used to store values like numbers, strings, booleans, or objects.

lua
CopyEdit
local name = "Player1"
local age = 16
local isActive = true

local makes it usable only in the current block or script.

โฑ๏ธ WAIT FUNCTION

Used to pause the script for a set amount of time (in seconds).

lua
CopyEdit
wait(1) -- pauses for 1 second
print("One second later...")

๐ŸŸข IF STATEMENTS

Used to make decisions based on conditions.

lua
CopyEdit
local health = 50

if health <= 0 then
    print("Game Over")
elseif health < 100 then
    print("Low Health")
else
    print("Full Health")
end

๐Ÿ” WHILE LOOPS

Repeats code while a condition is true.

lua
CopyEdit
local count = 0

while count < 5 do
    print(count)
    count = count + 1
    wait(1) -- optional delay so it doesnโ€™t freeze the game
end

๐Ÿ” FOR LOOPS

A for loop repeats code a set number of times.


๐Ÿง  Think of it like this: