Lesson 4 of 8
A code editor from zero: VS Code and Cursor
Learn VS Code from zero for Roblox development: open a folder, search, use the integrated terminal, install the Luau Language Server, read Problems, and compare Cursor.
By the end you can
- Install VS Code, open a folder, and find any file or line with Quick Open and search.
- Use the integrated terminal, install an extension, and read the Problems panel.
- Install the Luau Language Server and compare VS Code with Cursor and Studio's script editor.
Before this: Your computer: requirements, files, folders and paths, The terminal from zero (PowerShell and macOS Terminal)
1Why not just Notepad?
Here is part of Beacon Yard's Config.luau, the file that owns every gameplay number:
local Config = {
ROUND_SECONDS = 40,
COOLDOWN_SECONDS = 8,
COIN_VALUE = 5,
COIN_RESPAWN_SECONDS = 4,
SURVIVAL_BONUS = 10,
DRONE_SPEED = 12,
DRONE_DAMAGE = 15,
DRONE_HIT_COOLDOWN = 1,
DRONE_MAX_HEALTH = 100,
WRENCH_DAMAGE = 34,
WRENCH_RANGE = 14,
STUN_SECONDS = 1.6,
WALK_SPEED = 16,
You could edit that in Notepad or TextEdit. A code editorCode editorA text editor for code: it colours syntax, numbers lines, searches whole folders and flags mistakes.Think of it as your bench in the workshop, with the project laid out on it. earns its place by doing four things a plain text editor cannot: it colours the code so you can read its structure, numbers every line so an error's line number means something, finds any name across hundreds of files in a second, and warns you about mistakes before you press Play.
Roblox Studio has its own Script Editor, and it is good for quick changes inside a place 1. Beacon Yard's code, though, lives as ordinary files in a folder, so that Git can track it and a tool called Rojo can copy it into Studio. Those files need an editor that works on folders. This course uses VS Code.
Why does this course edit Beacon Yard's code in VS Code rather than only in Studio's Script Editor?
Answer
The code lives as files in a folder, tracked by Git and synced into Studio by Rojo, so it needs a folder-based editor. Studio's editor is fine for scripts inside a place. Beacon Yard keeps its source as files, which Git tracks and Rojo syncs into Studio.
Open this step in lesson mode · Link to this step · This confused me
2Install VS Code
VS Code is free, under 200 MB to download and under 500 MB on disk, and it supports current Windows and recent macOS versions 2.
Windows. Download the User Installer from code.visualstudio.com and run it. On the Select Additional Tasks page, keep Add to PATH ticked; also tick both Add "Open with Code" action boxes, so you can right-click any folder and open it.
macOS. Download the macOS build from code.visualstudio.com, open the downloaded file, and drag Visual Studio Code into Applications. Then open VS Code, press Command + Shift + P, type shell command and choose Shell Command: Install 'code' and optionally 'copilot' commands in PATH (older versions call it Install 'code' command in PATH). Close the terminal window you were using and open a new one afterwards, so it picks up the change.
Build along
Open a new terminal (PATH changed, remember) and run
code --version.You should see A new terminal prints a version number (1.x.y), then a commit id and your processor type.
Open this step in lesson mode · Link to this step · This confused me
3Your bench in the workshop
| In the picture | In Roblox |
|---|---|
| The opened folder | The project you are working on |
| The parts tray | The Explorer, listing every file |
| Parts in your hands | Open tabs |
| Tools in the drawers | Extensions |
| The inspector's notes | The Problems panel |
| The tool counter built into the bench | The integrated terminal |
Think of VS Code as your bench in the yard's workshop. When you open a folder, you clear the bench and lay out one project. Everything you do afterwards applies to that project: search looks only inside it, and the terminal starts in it.
- The Explorer on the left is the parts tray: every file and folder in the project.
- Tabs along the top are the parts in your hands right now.
- Extensions are tools you add to the drawers.
- The Problems panel is where the inspector pins notes about mistakes.
- The integrated terminal is the tool counter from the last lesson, built into the bench.
Think of it as Your bench in the workshop, with one project laid out
Always open the project folder, not a single file. A single file on its own is a part with no bench: search, the terminal and the Luau checks all work less well.
You want to work on Beacon Yard. What should you open in VS Code?
Answer
The beacon-yard folder. Open the project folder. A single file loses project-wide search and checks, and your whole home folder makes every search crawl through thousands of unrelated files.
Open this step in lesson mode · Link to this step · This confused me
4Open a folder and make a file
You will get the real Beacon Yard code in the GitHub lesson. For now, make a practice copy of its config file.
Opening the practice folder with code ., creating Config.luau and saving it. The transcript below lists every action.
Transcript
- 0:00 Open the folder from a terminal: code .
- 0:03 VS Code asks: do you trust the authors?
- 0:06 Your own folder, so answer Yes.
- 0:10 New File in the Explorer: Config.luau.
- 0:14 The dot on the tab means not saved.
- 0:17 Ctrl+S saves. The dot goes.
Build along
Code/practice/Config.luau
Open a terminal in
Code/practice(make the folder if the terminal challenge did not) and runcode ., which opens the current folder in VS Code. When VS Code asks whether you trust the authors, choose Yes: it is your own folder.You should see VS Code's title bar and Explorer both show practice.
Click New File in the Explorer, name it
Config.luau, paste the code below, and save with Ctrl + S (Windows) or Command + S (macOS).You should see The Explorer lists Config.luau, the tab shows the code, and there is no dot on the tab after saving.
local Config = {
ROUND_SECONDS = 40,
COOLDOWN_SECONDS = 8,
COIN_VALUE = 5,
COIN_RESPAWN_SECONDS = 4,
WRENCH_DAMAGE = 34,
WRENCH_RANGE = 14,
WALK_SPEED = 16,
}
return Config
Open this step in lesson mode · Link to this step · This confused me
5Find anything: Quick Open, search, the Command Palette
Three shortcuts cover nearly every "where is it?" moment. On macOS, use Command wherever Windows uses Ctrl 3.
| Shortcut | Opens | Use it to |
|---|---|---|
| Ctrl + P | Quick Open | jump to a file by typing part of its name |
| Ctrl + Shift + F | Search | find a word in every file of the folder |
| Ctrl + Shift + P | Command Palette | run any VS Code command by name |
| Ctrl + F | Find | find a word in the current file only |
The Command Palette is the one to remember. If you forget a shortcut or a menu, press Ctrl + Shift + P and type what you want, such as format or terminal.

Select a numbered pin, or a row below, to read what it marks.
Ctrl+Shift+F searches every file in the folder.
Build along
Press Ctrl + Shift + F, search for
COIN_VALUE, and click the result.You should see The Search view lists Config.luau with the line COIN_VALUE = 5; clicking it puts the cursor on that line.
Open this step in lesson mode · Link to this step · This confused me
6The terminal inside the editor
Press **Ctrl + ** (the backtick key, usually left of 1) to open the <Term id="integrated-terminal">integrated terminal</Term>. On macOS the shortcut is also Control + . It is the same PowerShell or zsh you used in the last lesson, already standing in your project folder 4.
That last part saves a lot of cd. Whatever folder you opened is where the terminal starts. Later lessons run rojo serve and git from exactly here.
Build along
Open the integrated terminal and run
cat Config.luau.You should see The terminal's prompt ends in practice, and cat prints the Config table.
Open this step in lesson mode · Link to this step · This confused me
7Extensions: tools in the drawers
Good place for a break. Your answers and progress are saved in this browser, so you can stop here and come back to this step. Tick what you can do now; if something is shaky, go back one step first.
Checkpoint
- VS Code is installed and I can open a project folder
- I can find a file with Ctrl + P and a word with Ctrl + Shift + F
- I can open the integrated terminal and see which folder it starts in
VS Code does a lot on its own, and extensionsVS Code extensionAn add-on that gives VS Code a new language, tool or theme.Think of it as a tool added to the drawers of your bench. add the rest: support for languages, linters, themes. Open the Extensions view with Ctrl + Shift + X 5.
An extension is a program that runs with your permissions, so install with care:
- Check the publisher and the install count, and look for a link to the source code.
- Install only what you need. This course will name every extension it uses.
The first one is the Luau Language Server by JohnnyMorganz, extension id JohnnyMorganz.luau-lsp 6. It is open source and is the standard Luau extension in the Roblox community 7.
Both sidesRemember: A code editor is your bench in the workshop, with one project laid out.

Select a numbered pin, or a row below, to read what it marks.
Check the publisher before you install.
Build along
Search the Extensions view for
luau-lsp, check that the publisher is JohnnyMorganz, and click Install.You should see The extension page shows Uninstall and Disable instead of Install, and the status bar briefly shows the language server starting when you open Config.luau.
Open this step in lesson mode · Link to this step · This confused me
8The Problems panel
Now make a mistake on purpose. In Config.luau, delete the comma after COIN_VALUE = 5. A red squiggle appears under the next line almost at once.
Open the Problems panel with Ctrl + Shift + M. It lists every error and warning in your open files, with the file name and line number. Click an entry to jump straight to it. For the missing comma, the Luau Language Server reports:
Expected ',' after table constructor element
That error points at line 5, COIN_RESPAWN_SECONDS = 4,, rather than line 4 where the comma is missing. The parser only realised something was missing when the next item began. Errors often point just after the real mistake, and the errors lesson comes back to this.

Select a numbered pin, or a row below, to read what it marks.
The error names line 5. The missing comma is at the end of line 4.
Problems says: Expected ',' after table constructor element, on the COIN_RESPAWN_SECONDS line. Fix the code.
local Config = {
COIN_VALUE = 5
COIN_RESPAWN_SECONDS = 4,
}
print(Config.COIN_VALUE)
Answer
Line 2: COIN_VALUE = 5. Fixed: COIN_VALUE = 5,. The missing comma is at the end of the line before the one the error names. Put it back and the file parses again.
Open this step in lesson mode · Link to this step · This confused me
9What the Luau Language Server gives you
With the extension installed, VS Code understands Luau and Roblox:
- Autocomplete. Type
game:Getand it suggestsGetService. - Hover documentation. Point at a Roblox API name to read its docs without leaving the editor. The latest Roblox type definitions are loaded by default 7.
- Errors before Play. Syntax errors, unknown names, and (in files that turn on stricter checking, which module 2 teaches) mismatches such as adding text to a number, all in the Problems panel.
One piece is missing for now. The extension does not know which Roblox objects your place contains until a tool called Rojo describes the project to it. That arrives in the setup lesson, along with the companion settings. Until then, plain Luau files work fully and Roblox-specific paths are partly checked.
What does the Luau Language Server add to VS Code?
Answer
Autocomplete for Luau and Roblox APIs; Documentation on hover; Errors in the Problems panel before you press Play. It is a language server: it reads your code and reports on it. Running the game happens in Studio, and getting code into Studio is Rojo's job.
Open this step in lesson mode · Link to this step · This confused me
10Where the bench idea breaks
On a real workbench, once you have filed a part down, it is filed. Anyone who picks it up gets the new shape.
In an editor, your changes live in the editor's memory until you save. The file on disk, which Git, Rojo and Studio all read, keeps its old contents. A tab with unsaved changes shows a dot instead of a close button, and the Explorer shows a count of unsaved files.
You can make the dot a non-issue. Open the File menu and click Auto Save; a tick appears next to it, and VS Code now saves a file shortly after you stop typing.
Build along
Turn on File, Auto Save, then edit any file and watch the dot.
You should see The File menu shows a tick next to Auto Save, and a file you edit loses its unsaved dot a moment after you stop typing.
Where does it break?“Your bench in the workshop, with one project laid out” is a good picture of a code editor. Where does it stop being true?
It breaks here. Work on a real bench is real at once, but in the editor nothing reaches the disk, or the game, until you save.
The true model. The editor holds an in-memory buffer for each open file. Saving writes the buffer to the file on disk, which is the only copy that Git, Rojo and Studio can see.
You change COIN_VALUE to 10 in VS Code. The tab shows a dot. Rojo is syncing and you press Play. How much does a coin pay?
Answer
5, because the change is not saved, so the file on disk still says 5. Rojo copies the file on disk into Studio, and the disk still says 5. Save first. To make this automatic, turn on File, Auto Save.
Open this step in lesson mode · Link to this step · This confused me
11Settings Sync
Once you have VS Code the way you like it, Settings Sync keeps your settings, keyboard shortcuts and extensions the same on every computer you use. Turn it on from the Accounts menu (the person icon at the bottom of the Activity Bar) with Backup and Sync Settings, and sign in with a GitHub or Microsoft account 8.
It is optional, and handy if you switch between a school computer and a home one. Settings Sync never syncs your project files. Those travel through Git and GitHub, in the next two lessons.
Build along
Optional: turn on Settings Sync with your GitHub account.
You should see The Accounts menu shows Settings Sync is On, or you have decided to skip it for now.
Open this step in lesson mode · Link to this step · This confused me
12Cursor and other editors
VS Code is not the only choice. Here are the common ones, honestly compared.
Which editor?
| Option | What it is | When pros pick it | Trade-offs |
|---|---|---|---|
| VS Code | A free editor from Microsoft, and the one this course shows in every screenshot (the course default). | Most Roblox teams that keep game code in files and sync it with Rojo; the Luau Language Server is built for it first. | Extensions run with your permissions, so install only what you need. |
| Cursor | An AI-native editor built on VS Code's open-source base, so it looks and works almost the same. It imports your VS Code extensions, themes and settings in one click. | You already use it, or you want AI help inside the editor. Everything in this course works in it. | The free plan has limited AI usage. Its extensions come from the Open VSX registry, where the Luau Language Server is also published. Use its AI as a tutor that explains, not one that writes your work. |
| Studio's Script Editor | The editor built into Roblox Studio. | Small edits to scripts that live only inside a place. | Changes made there never reach the files Git tracks, so in Beacon Yard you edit files instead. |
| Other editors (Neovim, Zed, JetBrains) | Editors that speak the language server protocol, so the Luau Language Server can run in them. | Only if you already use one and like it. | This course will not cover their setup; the language server's repository links a guide for editor clients. |
You already use Cursor. What do you need to change to follow this course?
Answer
Nothing important: install the Luau Language Server from Cursor's extension view and map the VS Code shortcuts as you go. Cursor is built on VS Code's base and its extension registry carries luau-lsp. Shortcuts and menus are almost the same.
Open this step in lesson mode · Link to this step · This confused me
13Challenge: find and change
Level 1, Apprentice
Challenge
Find a value in the practice project the way a developer does, change it, and check your work three ways.
- Start from
- VS Code with Code/practice open and Config.luau saved.
Done means
- Using Search (not scrolling), you found WRENCH_RANGE and changed it from 14 to 16.
- The tab shows no dot: the change is saved.
- In the integrated terminal, cat Config.luau shows WRENCH_RANGE = 16.
- The Problems panel shows zero errors.
Hints
- Ctrl + Shift + F, or Command + Shift + F on macOS, opens Search.
- If Problems shows an error, check the commas at the ends of lines.
Open this step in lesson mode · Link to this step · This confused me
14Recap
Retiring the analogy
You no longer need “your bench in the workshop, with one project laid out”. The editor holds an in-memory buffer for each open file. Saving writes the buffer to the file on disk, which is the only copy that Git, Rojo and Studio can see.
Recap
- Open the project folder, not a file. Ctrl + P finds files, Ctrl + Shift + F searches every file, and Ctrl + Shift + P runs any command.
- The integrated terminal (Ctrl + `) starts in your project. Extensions run with your permissions; the Luau Language Server adds autocomplete, hover docs and errors in the Problems panel.
- Nothing reaches the disk, Git or Studio until you save: a dot on the tab means unsaved. Cursor works the same way, with the same extension.
A code editor is your bench in the workshop, with one project laid out, until work on a real bench is real at once, but in the editor nothing reaches the disk, or the game, until you save.
Queued for review
- You want to work on Beacon Yard. What should you open in VS Code?
- Problems says: Expected ',' after table constructor element, on the COIN_RESPAWN_SECONDS line. Fix the code.
- You change COIN_VALUE to 10 in VS Code. The tab shows a dot. Rojo is syncing and you press Play. How much does a coin pay?
- You already use Cursor. What do you need to change to follow this course?
Open this step in lesson mode · Link to this step · This confused me