Step 1 of 14, updated

What ShotScript is

The Luau you already write, one declaration per file. shot writes the strict Luau around it and checks it all.

You'll learn what a .shot file becomes, the three kinds of project, and the project this guide builds.

What you get

  • Less to write. A class is one block; a system's types are written once.
  • Mistakes before anything runs, at the .shot line and column.
  • Rules Luau can't see: sides, events, match, start order, owned fields.
  • Plain Luau out. shot build writes a Rojo layout you can read.

Tip Inside a function body nothing changes: it is ordinary Luau, checked by the Luau type checker.

Project kinds

Roblox

A Roblox game: server and client code, remotes, built into plain Luau for Studio.

Runs in Roblox--kind roblox
System

A tool on your computer: on its own with shot run, or in the editor's window.

Runs on your computer--kind system
Generic

Code any project can use: plain Luau and the shared datatypes, no services.

Runs where it is used--kind generic

shot new makes a project in one file, <Name>.ssp (System when you don't say a kind):

$ shot new Coins --kind roblox
made Coins.ssp: a Roblox project, the library Coins (Coins/Coins.shot); shot check checks it, and building it for Roblox comes later (shot open Coins.ssp)
FileCoins.ssp
shotsystem 1
kind Roblox
export Coins

id e00c8b830b312ffbb9882ff43d0a7885
Folder Coins #0b2f8f2d
	Script Coins #82570725
		source
			types script.Parent.Types

			module Coins = {
				function Hello() : string
					return "Hello from Coins"
				end
			}
	Script Types #8852a1fc
		source (no newline at end)

Tip An .ssp is the whole project as text you can read and diff: the header, then one line per instance, one tab per level, each script's source under it.

$ shot check --project Coins.ssp
0 errors (2 files checked, 0.4 s)

The project in this guide

Watch out A Roblox .ssp is checked today, and its Roblox build comes later. So this guide builds a folder, MyProject, which shot build turns into Luau for Studio. The language is the same in both.

One system, Wallet, one idea a step:

Try it

Run shot new Hello, then shot run Hello.ssp. It prints Hello from Hello: a System project, whole in one file, running on your computer.