Create scripts
script_createCreate Script, LocalScript, or ModuleScript instances with Luau source, batchable into one undoable step. Supports run context and disabled scripts.
Instructions
Creates Script, LocalScript or ModuleScript instances with their source.
Batch related scripts into one call: they are created inside one ChangeHistoryService recording, so the user can drop a whole generated system in a single undo. The response says whether that recording was actually opened — Studio refuses while another one is in progress.
Prefer Script with runContext: "Client" over LocalScript in new work — a Script with an explicit RunContext runs wherever you parent it, while LocalScript only runs under a player's character, backpack or PlayerGui. Use script_edit to change a script that already exists.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scripts | Yes | Scripts to create together as one undoable step. | |
| studioId | No | Target Studio; omit for the active one. |