Connect Studio and Cursor safely
Roblox Studio and Cursor do different jobs. Studio owns the data model, scene objects, simulation, Output, debugger, device emulation and publishing. Cursor edits the Luau files that Studio synchronizes to disk, explains code, reviews diffs and helps reason from evidence. Neither app replaces the other.
This course uses Roblox's built-in Script Sync. Cursor is explicitly listed as a supported external editor. You do not need Rojo for this learning path, and there is no beta-toggle step in the official setup. Rojo is a separate option for teams that want the entire filesystem to become the project source of truth; that is not our beginner workflow.
Build a script-only hierarchy in Studio
In a disposable Baseplate, create these Folder instances. Do this in Studio because these are data-model objects:
ServerScriptService
CourseServer Folder
ReplicatedStorage
CourseShared Folder
StarterPlayer
StarterPlayerScripts
CourseClient Folder
Keep Parts, Models, SpawnLocations, UI designed in Studio and other non-script instances outside these synced folders. Script Sync synchronizes Script, LocalScript, ModuleScript and Folder instances. It ignores other instances, attributes and tags. Mixing scene objects into a synced script tree creates a misleading partial filesystem view.
Sync the folders to disk
Repeat these Studio actions for each course folder you need:
- In Explorer, select the Folder.
- Right-click and choose Sync to….
- Choose one local course directory and map the folders to
src/server,src/sharedandsrc/client. - Right-click the Folder again and choose Script Sync > Reveal in Finder on macOS.
- Open the course directory in Cursor.
Syncing a folder includes its child folders and scripts. Creating, renaming, moving or deleting managed children on either side is synchronized. Studio remembers the sync when you reopen the place. Do not have two people edit the same synced script at once.
Memorize the filename contract
The suffix determines which Studio instance appears:
| Disk filename | Studio instance |
|---|---|
Name.server.luau |
Script with RunContext = Server |
Name.client.luau |
Script with RunContext = Client |
Name.local.luau |
LocalScript |
Name.luau |
ModuleScript |
Name.legacy.luau |
Script with RunContext = Legacy |
This course uses .local.luau when a lesson specifically calls for a LocalScript. Do not casually swap it for .client.luau; both can execute client code, but they create different instance classes and have different placement/lifecycle expectations.
Make the first synchronized script
With Studio not playing, create src/server/first-script.server.luau in Cursor:
-- Script: ServerScriptService > CourseServer > FirstScript
print("Studio received a saved Cursor edit")
Save the file. In Studio, inspect CourseServer: FirstScript should appear as a Script with Server RunContext. Use Play, read server Output, then Stop.
Cursor saves agent edits to disk immediately. With Script Sync active, Studio may receive an edit before you finish reviewing the diff. There is no reliable “Accept, then sync” boundary. Use this loop instead:
- Stop the Studio simulation.
- Create a version-control commit or another small known-good checkpoint.
- Ask Cursor for one narrow change with explicit file and constraints.
- Watch and review the saved diff immediately; stop or revert if it expands scope.
- Inspect the resulting class, name and hierarchy in Studio.
- Run the named Studio test and read the correct server or client Output.
- Stop, record what actually happened, then checkpoint only the understood result.
Start with explanation, not generation
Use Cursor as a tutor before using it as an implementer:
Open @src/server/first-script.server.luau. Do not edit it. Explain why Script Sync creates a server Script from this filename, where it should appear in Studio, which app can prove that it ran, and what evidence I should collect. End with one tiny learner-written change.
Review the answer. Cursor can read the file but cannot see the complete Studio scene, operate Studio's debugger, or certify that the message appeared. Those are Studio observations.
Handle conflicts and deletion safely
When disk and Studio differ at sync startup, Studio shows the affected scripts and asks you to choose Keep Studio or Keep Disk. Read the list; do not select a side from habit. Preserve the version containing the intended change, then inspect the result.
Deleting a child script synchronizes normally. Do not delete a top-level synced root folder from Finder. In Studio, choose Script Sync > Stop Sync, choose what to do with local files, and then delete the root deliberately. Script Sync does not preserve script attributes or tags, so do not attach those to synced scripts.
Cursor context and privacy
Attach exact files or folders with Cursor @ mentions when you know what matters. The synced code tree is not the full Studio data model, so also provide a short text hierarchy and exact Output when debugging. Never paste passwords, authentication cookies, recovery codes, account identifiers, private chats, personal names or production player data. Keep Cursor's manual approval safeguards enabled and avoid “edit everything” prompts.
A root AGENTS.md is the simplest optional way to give Cursor durable project guidance. This course does not require it and does not install extensions. Roblox recommends an optional community Luau language server for richer editor assistance, but extensions and the companion plugin require their own trust decision and are not prerequisites here.
Verify before continuing
first-script.server.luaucreates the expected server Script inCourseServer.- The message appears in server Output during Play.
- A one-line Cursor edit appears in Studio only after saving.
- You can identify the diff before testing.
- You can explain why scene Parts remain Studio-owned.
- You know where to Stop Sync before removing a root.
The examples in this manual are statically reviewed but were not executed in Roblox Studio while authoring this edition. Your Studio checks are the runtime evidence.
Verified 2026-10-03: Script Sync, data model, script types and locations, Cursor prompting, Cursor agent security.
Previous: Set up Roblox Studio on Mac · Next: Learn Luau through engine code