edit_script_lines
Replace specific lines in a Roblox script using instance path, line range, and new content. Avoid rewriting the entire source.
Instructions
Replace specific lines in a Roblox script without rewriting the entire source. IMPORTANT: Use the "numberedSource" field from get_script_source to identify the correct line numbers. Lines are 1-indexed and ranges are inclusive.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endLine | Yes | Last line to replace (inclusive). Get this from the "numberedSource" field. | |
| startLine | Yes | First line to replace (1-indexed). Get this from the "numberedSource" field. | |
| newContent | Yes | New content to replace the specified lines (can be multiple lines separated by newlines) | |
| instancePath | Yes | Roblox instance path to the script (e.g., "game.ServerScriptService.MainScript") |