Run Luau in Studio
execute_luauRun custom Luau scripts in Roblox Studio to read data, perform calculations, or call engine APIs that dedicated tools don't cover, and retrieve printed or returned output.
Instructions
Runs Luau in Studio's plugin context and returns whatever it printed, returned, or threw.
This is the escape hatch. Reach for it only when no dedicated tool fits — create, modify, delete, move, script_edit and find validate their input, type values from the live API dump, and wrap writes in an undo recording. Code run here does none of that, so a typo becomes a runtime error instead of a suggestion, and changes it makes may not be undoable as one step.
Good uses: reading something no tool exposes, a one-off calculation over many instances, or calling an engine API the tools do not cover.
Output printed while it runs is captured and returned, so print is a reasonable way to get values out. return works too, including returning a table — it comes back as a structure, not a summary. There is no timeout: an infinite loop will hang Studio until it is force-quit.
Against a running playtest server, Studio disables loadstring, so the code is compiled through a ModuleScript instead and runs at script identity — plugin-only APIs are unavailable there. When that happens it is stated in the result rather than left to be inferred from a failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Luau to run. In an editor session this has plugin permissions, so `game`, `workspace` and plugin-only APIs are all reachable. | |
| studioId | No | Target Studio; omit for the active one. |