Module reference
Twill installs as two ModuleScripts, both named Twill. Both are required.
| Module | Contents |
|---|---|
ReplicatedStorage.Twill | The modules a client is allowed to see, the client half of each kit, and the root table. |
ServerScriptService.Twill | The server half, and the server half of each kit. Never replicated. |
The root table resolves modules lazily, so a single require reaches everything:
local Twill = require("@game/ServerScriptService/Twill")
Twill.Log -- sharedTwill.Data -- server onlyTwill.Kits.Trade -- a kit, its server half on the serverRequiring a module directly works too, and is the better choice inside a client module that must not wait. See Admin for the one case where it is required rather than preferred.
The root table also carries Twill.Version, which is the quickest way to confirm
an install answered at all.
Shared modules
Section titled “Shared modules”Available on the server and the client.
| Module | What it does |
|---|---|
| Lifecycle | Service discovery, boot order, and the player pipeline. |
| Net | Declaring remotes, and serving them with metering and validation. |
| Replication | Publishing server state and reading it on the client. |
| Scope | Cleanup bags tied to a player, a character, or a life. |
| Bag | The cleanup container those bags are, and how it closes. |
| Signal | Events of your own, where every listener runs. |
| Log | Scoped, level-filtered logging. |
| Schema | Declarative validation for values you did not write. |
| Limit | Token buckets, per-player allowances, and log throttling. |
| Loop | Repeating work, delays, and spreading a list across frames. |
| Watch | Following a set of instances as it changes. |
| Format | Numbers and durations turned into readable text. |
| Serialize | Roblox values in a shape a DataStore accepts. |
| Compress | Large values made small and safe to send as text. |
| Tree | Instances described as data and built in one pass. |
| Error | One listener for every unhandled script error. |
| BigNumber | Exact whole numbers with no ceiling. |
| Chance | Weighted draws, and the odds behind them. |
| Tween | Values moved over time, every one of them on a single loop. |
| Async | Yielding work with a deadline, run together, or tried again. |
| Pool | Parts and models reused rather than cloned and destroyed. |
| Navigation | Agents that walk somewhere, and one loop driving all of them. |
| Authorization | Ranks, and the questions that depend on them. |
| Admin | An in-game command console built on Cmdr, with nine commands of its own. |
Server-only modules
Section titled “Server-only modules”Requiring any of these from a client fails with a message naming the module.
| Module | What it does |
|---|---|
| Data | Player data, with versioning, migrations, and branches. |
| Store | The key held by one server at a time, under Data. |
| Monetization | Developer products and passes, granted once. |
| Leaderstats | The Roblox player list, filled from replicated state. |
| Filter | Player-written text made safe to show. |
| Random | Unpredictable draws, and rolls a player can audit. |
| Token | Signed text that proves nobody edited it. |
| Shared | Cross-server messages and memory store maps, within one budget. |
| Config | Live experience configs, with a default for every key. |
| Teleport | Players sent between servers, with carried data kept off the client. |
| Board | A leaderboard read from a cache and written in batches. |
A kit covers one kind of game feature rather than every game. Kits ship inside
Twill and load only when named, as Twill.Kits.<Name>: the server half on the
server, the client half on a client.
| Kit | What it does |
|---|---|
| Inventory | Items a player holds, in named containers, changed whole or not at all. |
| Wallet | Currencies a player holds, which never go below zero or past their ceiling. |
| Trade | Trades between two players on one server that cannot duplicate or lose an item. |
Modules with two halves
Section titled “Modules with two halves”Four modules span both sides under one name. Net, Replication,
Authorization, and Admin each have a server half that is not replicated, and
their pages mark every member that only exists there.
Reading the badges
Section titled “Reading the badges”Every member on every page carries the sides it exists on.
| Badge | Meaning |
|---|---|
[Server] | [Client] | Available on both. |
[Server] | Calling it from a client fails. |
[Client] | The receiving half of a module whose publisher is server-side. |
Reading the signatures
Section titled “Reading the signatures”Signatures are written as Luau type annotations, taken from the source.
function Limit.PerPlayer(rate: number, burst: number?): AllowanceA trailing ? means the argument may be omitted or the return may be nil.
self appears in a signature only where the member is called with a colon.
Generic parameters such as <T> mean the module hands back whatever type you
put in. Nothing is checked at runtime by the generic itself.