Editing in VS Code#
The in-world editor is fine for one script. Once your world has a dozen, you want the editor you already know, with your keybindings, your extensions and your split panes.
Opening the project#
Open in VS Code, on the editor's top bar, writes your whole world to a folder and opens it. Saving a file there applies it to the running game.
The same button lives in the inspector under Scripts, where it opens the project already focused on the script you were looking at.
What you get#
%LOCALAPPDATA%\Hungrit\projects\<your world>\ scripts\ your game. This is all of it. Front door-7\ main.luau lock.luau Scenery-3\ a group in the scene tree is a folder here Turret-12\ main.luau .hungrit\ generated. Never edit in here. types\hungrit.d.luau the whole API, as declarations project.json which file is which script of which object .vscode\settings.json yours. Written once, never overwritten. .luaurc yours README.md generatedOne folder per object, one file per script. The number in the folder name is the object's id. Two objects can share a name, and without the id one of them would quietly take the other's scripts.
main.luau is the default slot, the one the game calls script.
Groups are folders. Arrange your world into groups in the scene tree and the project follows the same shape, nesting as deeply as you nested. Move an object into a group in the game and its file changes folder the next time the project is written.
Parts of a linkset are not folders. A part is matter, not a container.
Creating a script from VS Code#
A .luau file you create anywhere under scripts/ becomes a script on the object whose folder holds it, the moment you save something into it.
Deleting the file removes the script.
Autocomplete and type checking#
.hungrit/types/hungrit.d.luau declares the whole API. With luau-lsp installed you get:
- autocomplete on
self:,world:,players:and the rest - the option tables of every call
- an error on a typo before you save it into the world
Keep --!strict on the first line of every script. That is what turns the checking on.
Colour and autocomplete are two different things
Syntax colouring comes from whichever Lua or Luau extension you have installed. Autocomplete comes from luau-lsp reading the declaration file. Having one without the other is normal and does not mean your setup is broken.
What syncs, and when#
| You do | What happens |
|---|---|
| Save a file in VS Code | applied to the running game immediately |
| Change a script in world | the file is rewritten |
| Rename an object in world | its folder is renamed next time the project is written |
| Add an object in world | its folder appears next time the project is written |
The project is a view of the world, not a copy you merge back. There is no commit step and no conflict resolution. The world is the truth and the folder follows it.
Requiring your own modules#
A sibling script on the same object can be required by name. All three spellings mean the same module:
local cards = require("cards") -- the short form, used everywherelocal cards = require("./cards") -- what the editor can resolvelocal self = require("@self") -- the same, for a built-inThe bare name works and always will. The prefixed forms exist because an external editor cannot resolve a bare name into a file on disk, and reports "unknown require" on every line until you use one of them. Pick whichever you prefer and stay with it.
Code shared by the whole world lives on the object named Modules and is required as require("@modules/combat"). See Sharing code. Saving a module restarts every script that uses it.
Re-opening#
Pressing Open in VS Code again on a world you already have a project for adopts the existing folder quietly, and keeps your .vscode/settings.json and your .luaurc exactly as you left them.
Next#
- Trying things alone gives you a private copy to break
Updated 17 October 2026