studio_write_script
Update an existing Roblox Studio script safely by supplying expected_source for conflict protection; edits must be enabled, and changes are undoable.
Instructions
Update an existing script using expected_source for conflict protection. Requires edits enabled; undoable in Studio.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>",
"path": "<path>",
"expected_source": "<expected_source>",
"source": "<source>"
},
"name": "studio_write_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Instance name segments starting with a service; duplicate sibling names are rejected | |
| source | Yes | ||
| session_id | Yes | Exact session_id from studio_sessions. Never assume the current game is the intended target. | |
| expected_source | Yes |