Scripts


Write Luau the Roblox way, press F5 and watch it play. Stop, and whatever your scripts changed goes back.
No script runs in Edit. F5 runs them all; ShiftF5 puts back what they wrote, made or drew, and keeps your own edits.
Help as you type
Completion, hints and type errors know every instance in your project.
Luau's own type checker, as in Roblox Studio, rechecks a script a moment after each edit; hover an underline for its message. Fold any scope with the arrows beside the line numbers; guides mark each indented block, and Ctrl wheel zooms from 50% to 200%.






Where code lives
Share code in modules, play it in InitScripts, build with ToolScripts.
A ToolScript runs once when you press Run, and its changes are real. They're saved, and they're one undo step.
| ModuleScript | Required by other scripts |
| InitScript | Runs in Play and in renders |
| ToolScript | Runs once on Run; what it changes is kept |
| TypeScript | Luau types from the modules that point at it |
| Sandbox | A scope with its own Luau VM |
| Script layers | A video layer that returns function(time) |
| Tasks | task.spawn, delay, wait, RunService.Heartbeat, on play time |
Stroke has no Script. An InitScript is what runs in Play and in renders. View > Window > Profiler times each frame's script runs and your debug.profilebegin scopes; click a row to open its script.
Type less
Type ! and a word to drop in a require, a path or a CFrame.
Most read the Explorer's selection, so select a module and !selected writes its require line.
!module | Every module this script may require |
!selected | Require the selected module |
!reference | The selected instance's path |
!cook | Read the selected Cook track |
!CFrame | The selected instance's CFrame |
!viewport | The CFrame of the view you moved last |
!b Name | A bookmark banner |
!class Name | A class with new and Destroy |
a:=Lerp(b, 0.5) | Short for a = a:Lerp(b, 0.5), with any method |
