Bobrix Docs

Scripting Basics (Luau)

Roblox scripts use Luau, derived from Lua 5.1, with gradual typing and analysis tools. You manipulate Instances (objects in the data model), connect to events, and call methods on services.

ConceptExample
Variables & Typeslocal coins:number = 0 local name:string = "Player"
Functionslocal function add(a:number,b:number):number return a+b end
Eventsworkspace.Part.Touched:Connect(function(hit) print("Touched by", hit.Name) end)
Serviceslocal Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage")
Modules-- ModuleScript local M = {}; function M.greet(n) return "Hello, "..n end; return M
Client vs Server: Use LocalScript for UI/input/camera, and Script (server) for data, security, and authoritative gameplay.