Editing Scripts

Revix can read, edit, rewrite, rename, move, and delete any Script, LocalScript, or ModuleScript in your game. It uses three tools in layers — read first, then edit surgically, and only rewrite the whole thing when really needed.

The three core tools

ToolWhen to useWhat it does
`read_script`Always firstRead whole file, a line range, or a function outline with line numbers
`edit_script`Most editsSearch-and-replace edits — surgical, leaves the rest untouched
`write_script`Rewrites and new filesFully replaces or creates a script

Revix follows this order automatically: read, then edit, and only rewrite when the change is large enough to justify it.

Reading scripts

read_script has three modes:

ModeUse for
Whole fileSmall scripts, quick scans
Line rangeBig files where you know roughly where to look
Function outlineBig files where you want a structural map first

The outline mode returns each function name with its starting line number, so the AI can jump straight to the relevant range instead of pulling thousands of lines into context.

Surgical edits

edit_script is the workhorse. It takes a find string and a replace string and applies the change. Indentation and surrounding code are preserved exactly.

text
In ServerScriptService.PlayerHandler, change the starting coins from 100 to 250.
text
In ReplicatedStorage.Modules.Inventory, rename the function AddItem to GrantItem and update all call sites in the same module.

The AI reads the script first, plans the smallest possible change, then applies it.

Full rewrites and new scripts

write_script replaces the entire body of a script — or creates a new one if it doesn't exist. Use this for new files or for large restructurings where surgical edits would be messier.

text
Create a new ModuleScript at ReplicatedStorage.Modules.CombatService with placeholders for Attack, Block, and Parry methods.
text
Rewrite ServerScriptService.OldShopHandler into a cleaner module-based structure.

Deleting, moving, renaming

These use delete_instance, move_instance, and set_properties respectively. Just ask in plain language.

text
Delete ServerScriptService.DebugHandler.
text
Move ReplicatedStorage.Old.PlayerData under ReplicatedStorage.Modules and rename it to PlayerData.

Undo support

Every edit Revix makes creates a Studio undo waypoint:

  • Before Revix Command
  • After Revix Command

Ctrl+Z in Studio undoes the entire command in one step, no matter how many tool calls were involved. Ctrl+Y redoes it. This makes it safe to let Revix try things — you can always roll back.

Script types supported

TypeClass
Server script`Script`
Client script`LocalScript`
Module`ModuleScript`

Revix can create any of the three and place them anywhere in the data model.

Troubleshooting

  • Edit failed because the find string wasn't unique: ask Revix to include more surrounding context in the search.
  • AI rewrote a script when you wanted a surgical edit: explicitly ask for "a surgical edit, don't rewrite the file".
  • Lost work: use Studio's Ctrl+Z — every Revix command is one undo step.
  • For finding code across many scripts, see Searching Your Game.