Create scripts
script_createCreate Roblox scripts at a target parent path with their Luau source, batching related Script, LocalScript, or ModuleScript instances into one undoable Studio operation.
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.
The exception is the starter containers — StarterGui, StarterPack, StarterPlayerScripts, StarterCharacterScripts. They are COPIED into each player, so a Script with a non-Legacy RunContext there runs once where it sits and again in every copy, while a Legacy one does not run at all. Use LocalScript inside those. Creating one anyway comes back with a warning, because Studio's own warning about it goes to its Output and never reaches console.
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. |