Setup Guide
- Familiarity with the command line. You can find tutorials on YouTube for Windows or MacOS
- NodeJS 18+
- A code editor such as VSCode
- Rojo 7+ which can be installed through the Rojo VSCode plugin.
If you're using PowerShell for the first time, you may get an error about "running scripts is disabled on this system". You can fix this by running the following in PowerShell as an administrator:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Project Setup
In this guide, we will introduce how to create a roblox-ts game.
Make sure you have an up-to-date version of Node.js installed and your current working directory is an empty folder that you intend to create your project in. Run the following command in your command line:
npm init roblox-ts
The tool will guide you through some questions to set up your project:
Project directory
- Since you're already in the directory you want to create a project in, just enter a period (.
) to select your current directory and pressEnter
.Select template
- What type of roblox-ts project is this? roblox-ts can be used to build plugins and packages too, but in this case we want to make a game, so pressEnter
once.Configure Git
- Do you want to use Git for version control? PressY
orN
to make your choise.Configure ESLint
- Do you want to use ESLint to check your code for correctness?Configure Prettier
- Do you want to use Prettier to format your code?Configure VSCode Project Settings
- Do you want the tool to create a.vscode
folder with settings optimized for roblox-ts development? If you're using VSCode to write code, you should use this.Multiple package managers detected. Select package manager:
- Which package manager do you want to use with this project? roblox-ts works best withnpm
and support for alternative package managers is not guaranteed. (If you don't have other package managers installed, this step won't appear!)
Many of the tools used here can be directly integrated into VSCode with extensions. We highly recommend the roblox-ts extension to improve your editing experience. The roblox-ts extension not only provides extra diagnostic information, but also lets you build your code with one click.
Then, open your project in your code editor of choice, such as VSCode:
code project-name
Running Your Code
roblox-ts has a feature called "watch mode" where it will continuously build your code as you write it. You can start watch mode from the VSCode extension or via the command line:
npm run watch
Once roblox-ts is running, you need to start Rojo to start syncing your code into Roblox studio you can do this from the VSCode extension or via the command line:
rojo serve
You're all set up, go write some code 🎉