Search inside scripts
search_scriptsSearches decompiled Roblox game scripts by exact text, Lua pattern, or ranked word matches; narrow by root or class to find relevant code within a time budget.
Instructions
Search the source code of the game's scripts, like grep. Modes: text (exact text, default), pattern (a Lua pattern, always case sensitive) and words (every word must appear, scripts are ranked by how often they match). It decompiles the scripts, which can be slow (results are cached in the executor, set refresh to decompile again), so it stops after budget_seconds and reports how many scripts it searched. Narrow it with root or class_name for speed. Requires the connected state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | How to match the query (default text). | |
| root | No | Dotted path to search under (default game). | |
| query | Yes | What to look for. | |
| client | No | Client id from list_clients, for example c2. Defaults to the client that connected last. | |
| refresh | No | Decompile the scripts again instead of using cached sources (default false). | |
| class_name | No | Only search this kind of script. | |
| max_matches | No | Maximum matches to return (default 40). | |
| max_scripts | No | Maximum number of scripts to search (default 150). | |
| context_lines | No | Lines of context around each match (default 0). | |
| budget_seconds | No | Stop searching after this many seconds (default 20). | |
| case_sensitive | No | Match the case exactly (default false). | |
| include_hidden | No | Also search scripts outside the tree (default false). |