Run, pause and stop the simulation
playtestStart, run, or stop Studio simulation sessions and read their state, so scripts execute and can be observed without the user pressing anything.
Instructions
Starts and stops playtests, so scripts can be made to run and then observed without asking the user to press anything.
play is the Play button: a character spawns and Players.PlayerAdded fires. run is Run mode, which executes scripts with no player at all. multiplayer starts a test with several players for testing replication. addPlayers joins more players to a running multiplayer test, for late joins and lobby fill-up. state reports without changing anything.
Play and multiplayer return the playtest server's studioId once it connects. Use that ID directly for console, performance and execute_luau; the editor session has a separate log. If connection takes too long, the reply says so and list_studios can find it later.
A test does not block this call: it starts and the reply reports the state reached. Studio only ends it when something inside calls StudioTestService:EndTest(value) or when stop is used here; whatever EndTest passed comes back as lastResult on a later state. That makes a scripted check possible end to end: args is readable inside the test via StudioTestService:GetTestArgs(), so a test can be told what to do and report back what happened.
Stopping discards everything the playtest changed, exactly as pressing Stop does. Build in edit mode, then play — not the other way round.
The reply says whether the mode actually moved, not merely that Studio accepted the request.
The panel's playtests on grants permission, never a requirement: obey AGENTS.md, CLAUDE.md, user instructions and project guidance that prohibit playtesting even when ON. playtests off is a hard MCP lock: play, run, multiplayer and addPlayers are refused regardless of instructions to test; state and stop remain available. The lock only blocks starting simulation: screenshots, tree, inspect, script reads, edit-mode execute_luau and UI inspection stay available. Continue using edit-mode tools and static inspection where possible. Only the user can re-enable it with playtests on in the panel. Do not bypass the lock through execute_luau, Studio APIs or another operation. Manual Studio Play is unaffected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | 'play' starts a playtest with a character, 'run' runs scripts with no player, 'multiplayer' starts a several-player test, 'addPlayers' joins more to a running multiplayer test, 'stop' ends it and discards its changes, 'state' only reports. | |
| args | No | Value handed to the test, readable inside it with `StudioTestService:GetTestArgs()`. Use it to tell a test which case to exercise. | |
| players | No | multiplayer: how many players to start (default 2). addPlayers: how many to add (default 1). | |
| studioId | No | Target Studio; omit for the active one. |