wait(seconds)Pauses the script for a certain number of seconds (optional).
lua
CopyEdit
print("Wait 2 seconds...")
wait(2)
print("Done waiting!")
๐ง Use this in loops or to delay actions.
print(value)Prints something to the Output window for debugging.
lua
CopyEdit
print("Hello, world!")
print(myVariable)
๐ง Use this all the time when debugging.
Instance.new(className, parent)Creates a new object (like a Part, Light, GUI).
lua
CopyEdit
local part = Instance.new("Part", game.Workspace)
๐ง You use this to build stuff with code.
:WaitForChild("ChildName")Waits until a child object is available. Safer than directly calling .ChildName.
lua
CopyEdit
local player = game.Players.LocalPlayer
local char = player:WaitForChild("Character")
๐ง Prevents errors when something isnโt fully loaded yet.