Luau

A plain Luau file in your project, type-checked and required with its real types.

Luau is the class of a plain .luau file: a module that returns a table, or a program written in plain Luau with --!strict. It runs as a ModuleScript and is checked like the rest of the project. In a .luau file a service comes from require("@shotsystem/FileService") instead of use.

A script comes from the project's tree: add it in the editor and reach it through script or root.

Example

Programs and modulesShotScript
-- This program is a .shot file and Prices a plain Luau module (Prices.luau, returning a table): both are ModuleScripts.
use Prices

print("an Apple costs " .. Prices.Apple .. ", a Pear " .. Prices.Pear)
local files : {ModuleScript} = { script, root.Prices }
for _, file in files do
	print(file.Name .. ": ModuleScript " .. tostring(file:IsA("ModuleScript")) .. ", LuaSourceContainer " .. tostring(file:IsA("LuaSourceContainer")))
end
print("the program's Parent is the project's root: " .. tostring(script.Parent == root))
What it printedOutput
an Apple costs 3, a Pear 2
Main: ModuleScript true, LuaSourceContainer true
Prices: ModuleScript true, LuaSourceContainer true
the program's Parent is the project's root: true
From ShotInstance 33