Read scripts
script_readRead Luau source from Roblox scripts, including unsaved edits, with line numbers to pass to script_edit.
Instructions
Reads Luau source from one or more scripts, with line numbers that script_edit accepts back verbatim.
Source comes from the Studio script editor's live buffer, so anything the user has typed but not yet saved is included. Reading the saved property instead would hand you stale code and you would 'fix' the change they just made.
Pass every script you need in one call. startLine/endLine apply to all of them, so use them when following one range across several files and read whole files otherwise.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | Script paths, e.g. ["ServerScriptService.Systems.Combat"]. | |
| endLine | No | Last line to return, inclusive. Omit to read to the end. | |
| studioId | No | Target Studio; omit for the active one. | |
| startLine | No | First line to return, 1-based and inclusive. Omit to start at the top. |