In order to start using roblox-ts, you’ll need to have the following installed:
- A code editor. We recommend VSCode.
- Rojo 0.5.x. The easiest way to install it is through the Rojo VSCode plugin.
Once NodeJS is installed, you can install roblox-ts from the command line with:
npm install -g roblox-ts
The following is a reference for how to use the roblox-ts command line interface. This can be displayed with
Commands: build Build a project [default] init Create a project from a template Options: -p, --project project path [string] [default: "."] -w, --watch enable watch mode [boolean] [default: false] -w, --usePolling use polling for watch mode [boolean] [default: false] --verbose enable verbose logs [boolean] [default: false] --noInclude do not copy include files [boolean] [default: false] --type [choices: "game", "model", "package"] -i, --includePath folder to copy runtime files to [string] --rojo manually select Rojo configuration file [string] -h, --help show help [boolean] -v, --version show version information [boolean]
To start using roblox-ts to create a game project, follow these steps:
1. Create a new folder and name it whatever you’d like. We are going to name ours
2. Open a terminal with the working directory set to your created folder. You can also do this directly inside VSCode by pressing
Ctrl + ` while in your project directory.
rbxtsc init game inside your empty folder. This will create the required files to get you started:
4. Start roblox-ts in watch mode via
rbxtsc -w. You can exit watch mode later by clicking on the console and pressing
Ctrl+C on your keyboard.
5. Next, start up a Rojo server. If you are using the Rojo plugin, simply hit
Ctrl + Shift + P and select “Start Server”
Otherwise, open a new terminal with the same working directory and start Rojo via
rojo serve. In VSCode a new terminal can be opened by pressing the
6. Open a place in Studio you wish to sync your code to. Open up the Rojo plugin in Studio and hit
7. Write code!