sync_directory
Uploads a project directory to Roblox BedWars Creative Code Sync, replacing the active connection and optionally auto-uploading future Lua changes.
Instructions
Upload a specified directory now and retain it as the active Code Sync connection. Inputs: sync_token (required string from the editor Sync tab); directory (required string, project root path); glob_pattern (optional string, default empty: bwconfig.lua syncGlob or scripts/**/*.lua); allow_empty (optional boolean, default false: permit clearing remote scripts when no files match); probe (optional boolean, default false: write scripts/zz_sync_probe.lua unless allow_empty=true); probe_message (optional string, default empty: generated message); watch (optional boolean, default true: auto-upload future matching changes). Effects: uploads matching existing Lua files, removes exact legacy generated helpers, and on success replaces the in-memory connection and applies watch. Returns upload status, file details, connection/watcher flags, probe, and removed helpers.
Context: Choose when token and directory are explicitly available. It shares connect_sync's upload/session behavior; connect_sync additionally permits reusing the previous directory. For a single manual upload without auto-sync, set watch=false; the connection is still retained for sync_connected. Normal use does not prepare a project or generate scripts. allow_empty=true with no matches sends an in-memory .lua deletion payload; if legacy-helper cleanup leaves no matches, this is also permitted with allow_empty=false. Preview and validate before uploading; probe=true is for an explicitly requested visible test.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| probe | No | ||
| watch | No | ||
| directory | Yes | ||
| sync_token | Yes | ||
| allow_empty | No | ||
| glob_pattern | No | ||
| probe_message | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||