Run a Luau script on N clients in parallel
script-fanoutRun one Luau program across all or selected connected Roblox clients in parallel, returning per-client output, errors, and duration.
Instructions
Run ONE Luau program across multiple connected clients in parallel and return per-client results. Targets are chosen by either passing clients: ['<clientId>', ...] (explicit ids from list-clients) or clients: 'all' (every connected client). Each client gets its own scriptToken / RPC budget, and the same mcp.* surface (including mcp.all()) is available inside. Concurrency is capped to 8 in flight so a 50-client fanout doesn't saturate the bridge. Returns { results: [{ clientId, displayName, ok, result?, error?, output, durationMs }], summary: { total, ok, failed, totalMs } }. Pre-flight catches typo'd mcp.* calls before dispatch, so a typo doesn't fail N times. Signature: { clients: {string} | any, source: string, persistent: boolean?, timeoutMs: number?, rpcBudget: number?, threadContext: number? }. Phase: orchestrate; cost=high; idempotency=contextual-write. Requires: explicit-mutation-approval, validated-source. Produces: structured-result. Verify with: assert-state. Safety: MUTATING; writes live game/client state. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | The Luau script to run on every target client. Has the same `mcp.*` surface as the regular script tool. | |
| clients | Yes | Either an array of clientIds (from list-clients) or the string 'all'. | |
| rpcBudget | No | Per-client mcp.* RPC cap (default 500). | |
| timeoutMs | No | Per-client timeout in ms (default 60000). | |
| persistent | No | Each client's persistent VM is independent (default true = use VM env). | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |