A terminal running rojo serve next to Roblox Studio with the Rojo plugin connected
8 min read

Rojo + Cursor for Roblox: Our AI Coding Setup, and What We Use Now

To write Roblox code with AI you need two things: an editor where the AI works with your files, and a bridge into Roblox Studio. For a long time my bridge was Rojo and my editor was Cursor. Below is that setup, step by step. At the end: what changed when we started our game DARK, and what I use now.

What Rojo does

Studio keeps scripts inside the place file. AI editors work with files on disk. Rojo connects the two: you write .luau files in a folder, and every save lands in Studio. The code lives in git, any editor works, and the AI sees the whole project as normal files.

Step 1: Install Rojo

Use a toolchain manager like Rokit or Aftman. It installs Rojo per project and keeps the same version for everyone on the team.

rokit init
rokit add rojo-rbx/rojo
rojo --version

Then install the **Rojo plugin** in Studio (from the Creator Store, or with rojo plugin install). The command-line tool and the plugin talk to each other.

Step 2: Create a project

mkdir my-roblox-game && cd my-roblox-game
rojo init

You get a default.project.json and a src folder. The project file says which folder goes where in the game:

{
  "name": "my-roblox-game",
  "tree": {
    "$className": "DataModel",
    "ReplicatedStorage": {
      "Shared": { "$path": "src/shared" }
    },
    "ServerScriptService": {
      "Server": { "$path": "src/server" }
    },
    "StarterPlayer": {
      "StarterPlayerScripts": {
        "Client": { "$path": "src/client" }
      }
    }
  }
}

File names decide the script type: name.server.luau is a Script, name.client.luau a LocalScript, plain name.luau a ModuleScript.

Step 3: Connect it to Studio

rojo serve

Open your place in Studio, open the Rojo plugin, press Connect. From now on every save in your editor shows up in Studio a second later. Press Play in Studio as usual.

Step 4: Set up the editor

I used Cursor. VS Code works the same way.

  1. Install the Luau Language Server extension. It gives you autocomplete and type checking for the whole Roblox API, so the AI's mistakes show up red right away.
  2. Optional but worth it: StyLua to format the code and Selene to catch common bugs.
  3. Turn on `--!strict` at the top of your scripts. Typed Luau helps both you and the AI.

Step 5: Give the AI the rules of your game

The biggest improvement for me: a short rules file at the root of the project that the AI reads every time (AGENTS.md, CLAUDE.md or Cursor's rules file). Mine looks roughly like this:

# Game rules for the AI
- The server decides everything. Never trust the client.
- Each system in its own script; bind parts by CollectionService tags.
- Folder map: src/server = ServerScriptService, src/client = StarterPlayerScripts,
  src/shared = ReplicatedStorage.
- Player-facing text is English.
- Don't touch Roblox's built-in PlayerModule.

Without it, every session starts from zero and the model guesses. With it, the code fits the game.

Step 6: The loop

  1. `rojo serve` running, Studio connected.
  2. Ask the AI for one small thing: "a trapdoor that drops the player and sends them back to the lobby".
  3. Read the code, save, press Play in Studio.
  4. Paste the Output errors back to the AI if something breaks.
  5. Commit when it works.

Where Rojo got in our way

Rojo is great for code. But a game isn't only code. In DARK, our co-op horror obby, most of the first weekend went into the level itself: the lobby, the corridors, the door, the lighting, a flashlight because the dark corridor made the walls disappear. Those are parts and properties in Studio, not files. With Rojo, an AI can write the trap script, but it can't see the corridor the trap goes into. That's the old loop I wrote about before: describing the place in words every session, copying errors back and forth.

What we use now

For DARK I switched to Roblox Studio's built-in MCP server with Claude Code. Studio itself lets the AI read and change the live place: scripts, parts, lighting, a Play session. Turn it on in Studio under Assistant, Manage MCP Servers, "Enable Studio as MCP server".

  • The game lives in Studio, not in files. The AI looks at the same place I do.
  • Scripts are exported one way into git after each change, so we still have history and diffs. Nothing syncs back.
  • One rule I learned the hard way: build and change geometry while the game is stopped. Changes made during Play are thrown away.

The full setup is in my post about Studio MCP and Claude Code.

Which one should you pick?

  • Mostly code (systems, data, UI logic) and you want everything in git, or a team editing the same scripts: Rojo + Cursor or VS Code.
  • A level-heavy game where the AI needs to see the world, or you're just starting: Studio MCP.
  • Starting from zero with your kid? Learn Studio itself first: how to use Roblox Studio, step by step.

Questions about either setup? Ask us in our Discord.

Quick answers

Rojo is a free tool that syncs files from your computer into Roblox Studio. You write Luau in a normal code editor, Rojo pushes every save into Studio, and your scripts live in git.

Yes. Cursor edits the Luau files, Rojo syncs them into Studio, and the Luau Language Server extension gives you autocomplete for the Roblox API.

Rojo when your game is mostly code and you want everything in git. Studio MCP when the AI needs to see and change the live place: parts, lighting, the running game. For DARK we use Studio MCP with Claude Code and export scripts to git one way.

Keep reading

Comments

Loading comments...