Clean Up a Messy Place
By the end of this page you will know how to point Revix at a game you already have — not a blank baseplate — get it oriented, find the real problems, and fix them in small chunks you can actually review.
Time: an afternoon, split into short passes. Do not try to do this in one message.
Cost: several messages, each charged by how much work it takes, minimum 0.1 credits.
You need: Studio open on the existing place with the Revix plugin connected.
Before you start: save a copy of the place. Everything below is reversible through Studio's undo, but on a game you care about you want a copy anyway.
What you're building
Not a feature — a working method. Existing games are messy in specific ways: scripts named Script, logic in the wrong service, one 900-line file doing everything, parts floating unanchored in Workspace. Revix handles all of that, on one condition: go one category at a time and check after each pass.
The failure mode to avoid is "clean up my game". That produces a huge, unreviewable change that runs out of room halfway.
Step 1 — Open the place and let it sync
Open the real place in Studio and wait for the pill at the top of the dashboard to show your game's name with a green dot.
Revix syncs your scripts continuously in the background, so it can search the whole place without you doing anything. There is nothing to import and no button to press.
Step 2 — Get it oriented
Start by asking what is there. Keep the first ask shallow — a big place will overflow a deep listing.
Give me an overview of this place: list what is directly inside Workspace, ServerScriptService, ReplicatedStorage, StarterGui and StarterPlayer, two levels deep, with the class of each thing.What happens. Revix lists the tree with names, classes and full paths. It can cover up to six containers in one go and goes as deep as you ask, but it truncates enormous trees and tells you it did — that is your cue to ask about one branch at a time rather than the whole game.
Two other ways to orient yourself:
- Type
@in the composer to browse your connected game's tree and drop an exact path into your message. - Open the Game Map panel from the rail, press Import Game, and you get a pannable map of the experience you can zoom around and rename.
Then ask for the code picture.
Which scripts in this place are the biggest, and what does each one broadly do? Just the top ten, one line each.Step 3 — Ask it to find problems, and change nothing yet
Separate diagnosis from surgery. You want a list you can triage.
Scan this place for problems and list them by severity. Do not fix anything yet. I want: unanchored parts that should be static, zero-size or overlapping parts, scripts sitting in the wrong service, duplicated logic across scripts, and anything a player could exploit because the server trusts what the client sends.Check it worked. You should get a list you disagree with in places. That is normal and useful — pick the three you actually care about and ignore the rest for now.
You can also search the code yourself through Revix, plain text or a pattern, scoped to one branch:
Search ServerScriptService for every place that changes a player's coins, and show me the surrounding lines.On a very large place, the search runs over a prioritised set of files first and tells you to narrow the path if it did not reach everything. Take the hint — search one folder at a time.
Step 4 — Fix one category, then stop and look
Anchor every static part in Workspace that is currently unanchored, but leave anything that is meant to move — doors, platforms, vehicles — alone. List what you anchored and what you deliberately skipped.Press Play. Look. Then move to the next category.
Asking for the list of what it skipped is the trick that makes this reviewable. It turns a silent bulk edit into something you can argue with.
Step 5 — Rename and reorganise
Revix can rename instances and move them to a different parent, creating folders on the way.
In Workspace, rename every part called Part to something describing what it is, based on where it sits and what it is near. Group the shop props into a folder called Shop and the spawn props into a folder called SpawnArea. Tell me every rename you made as an old name to new name list.For scripts it knows where things belong: server logic in ServerScriptService, per-player client code in StarterPlayer, shared modules and remotes in ReplicatedStorage, screens in StarterGui.
There is a LocalScript in ServerScriptService that will never run there. Find it, work out whether it should be a server script or move to StarterPlayerScripts, and do the right one. Explain which you chose and why before you change it.Step 6 — Split a giant script
This is the highest-value pass, and the one most worth doing slowly.
First, get the map of the file:
Give me an outline of ServerScriptService.GameHandler: every function with its line range and one sentence on what it does.Then split by concern, one concern at a time:
Pull the data saving out of ServerScriptService.GameHandler into a ModuleScript in ReplicatedStorage called DataStore, keep the behaviour exactly the same, and update GameHandler to use it. Do not touch anything else in that file. Then read GameHandler back and confirm nothing else changed.What happens. Revix makes surgical edits that have to match exactly one place in the file, and it will not compile-broken code into your place — a Lua file with a syntax problem is rejected before it is ever written.
Check it worked. Press Play and run the thing that script handles. Then repeat with the next concern: purchases, then rounds, then whatever is left.
Step 7 — Keep the passes small
Two limits shape how you should work:
- A single message runs up to 120 steps or an hour, whichever comes first. A whole-game rewrite hits that.
- When it does, you get a card saying it stopped early with a Keep going button, or you type
continue. Nothing already done is undone.
Keeping one clean-up in a single chat also helps — Revix keeps a per-chat memory it reads at the start and updates as it works, so decisions you made in pass two are still around in pass six.
Things it cannot touch, and things it will not do
- ServerStorage is off limits. Revix cannot create, read, edit, move or delete anything inside ServerStorage. Ask for the work to happen in ReplicatedStorage or ServerScriptService instead.
- Nothing that only exists at runtime. Player objects, their screens, the local player — none of that exists in edit mode.
- It will not tidy code it was not asked to tidy. When you ask for a bug fix, it changes the responsible lines and leaves working code alone. That is deliberate. If you want a rewrite, ask for a rewrite.
Make it yours
Find every remote in this place that grants or spends anything, and tell me which ones the server does not validate.Pull all the tuning numbers in ServerScriptService — speeds, prices, cooldowns, timers — into one config module and point everything at it.Read StarterGui and tell me which screens have no script wiring their buttons.If something goes wrong
A pass changed more than you wanted. Ctrl+Z in Studio walks it back one change at a time, or ask directly with undo the last change — Revix can step Studio back up to 20 changes. One big batched operation can undo as a single step, so a lot can vanish at once. To go back further, use the Restore Checkpoint divider that sits above any earlier message whose answer touched Studio.
A listing came back truncated. Narrow it. Ask about one folder, or one level shallower.
It fixed the wrong copy of something. Duplicated files are the usual cause. Ask it to list every script matching the name and their full paths, then point at the one you mean with @.
The game broke and you are not sure which pass did it. Stop refactoring and switch to Debug a Script That's Broken — reproduce it, hand over the error, fix that one thing, then carry on.