read_script
Reads the full source of a Script, LocalScript, or ModuleScript with line numbers.
What it does
read_script returns the entire source of a script in your game, prefixed with line numbers so Revix can reference specific lines when reasoning or editing. The path is a DataModel path like ServerScriptService/GameManager — extensions like .lua are stripped and dots are converted to slashes.
Revix always reads a script before editing it. If a previous read is older than a few seconds — for example, after another edit has run — the cached copy can be stale, so Revix will re-read before making further changes. Synced files from the plugin are used when available; otherwise the plugin is asked for the file on demand.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| `path` | string | yes | DataModel path to the script (e.g. `ServerScriptService/GameManager`). |
When Revix uses it
- Before any
edit_scriptcall so theold_textmatch is grounded in real source - When grep finds a match and Revix wants the full context
- When you ask "what does this script do?" or similar inspection questions
- Right after a script edit to confirm the new state before chaining further edits
Example
ServerScriptService/GameManager (42 lines):
1 | local Players = game:GetService("Players")
2 | local ReplicatedStorage = game:GetService("ReplicatedStorage")
3 |
4 | local startGameEvent = ReplicatedStorage:WaitForChild("StartGame")
...Troubleshooting
If the read returns an error, the most common cause is the path being wrong or the plugin being disconnected. See editing scripts for the full read-then-edit workflow.