roblox-ts

Quick Start

A guide for getting up and going with roblox-ts.

Installation

In order to start using roblox-ts, you’ll need to have the following installed:

Once NodeJS is installed, you can install roblox-ts from the command line with:

npm install -g roblox-ts

Usage

The following is a reference for how to use the roblox-ts command line interface. This can be displayed with rbxtsc -h.

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]

Project Setup

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 my-project

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.

3. Run 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 + button.

6. Open a place in Studio you wish to sync your code to. Open up the Rojo plugin in Studio and hit Connect!

7. Write code!

It is recommended that you peruse through the Usage and Guides sections when getting started.

roblox-ts is still in development and you may run into situations where invalid Lua is emitted. Please report these cases to us either by creating an issue or joining our Discord server.