Installing Twill
Twill installs by dropping two ModuleScripts, both named Twill, into a place.
There is no package manager, no build step, and no external toolchain.
Download Twill.rbxm
The model file on each release holds both modules, already named. Insert it into a place with right-click → Insert from File, move each module to the service below, then check the install at step 3.
The steps below describe doing that in Studio. If you keep your source as files and assemble a place from them, keep doing so: Twill is indifferent to how the place was built, as long as both modules land where they belong. See It follows the place, not the folder.
Prerequisites
Section titled “Prerequisites”- Roblox Studio, and a place you can edit.
- Studio Access to API Services enabled, under Game Settings → Security. Without it, Studio cannot reach a DataStore. Twill then keeps player data in memory for the session, warns once, and forgets everything when you stop.
That is the whole list. Every dependency Twill uses is bundled inside the modules you are about to install.
1. Put both modules in place
Section titled “1. Put both modules in place”Both modules are required, and both come from the same release.
| Module | Goes in | Holds |
|---|---|---|
Twill | ReplicatedStorage | Everything both sides use, and the client half of each kit. |
Twill | ServerScriptService | Everything only the server uses, and the server half of each kit. |
The names and places matter. Twill finds its own server half by name, and a missing or renamed one fails at the require with:
[Twill] ServerScriptService.Twill.Net is missing; the server half is not installed2. Create a folder for your own services
Section titled “2. Create a folder for your own services”Add a Folder named Services inside ServerScriptService. Your own code goes
there, separate from Twill’s.
ServerScriptService├── Twill (Twill's server half)├── Services (yours, empty for now)└── Main (a Script, added in the quick start)3. Check the install
Section titled “3. Check the install”Add a Script anywhere in ServerScriptService and press Play.
local Twill = require("@game/ServerScriptService/Twill")
print(`Twill {Twill.Version} is installed`)Requiring the server module checks the whole install: it refuses to load when the other module is missing or comes from a different release. One line in the output means both are where they should be.
| Instead you see | Cause |
|---|---|
An error that Twill is not a valid member of ServerScriptService | The server module is missing or renamed. |
[Twill] ReplicatedStorage.Twill is missing; install both halves from the same release | The shared module is missing or renamed. |
[Twill] ReplicatedStorage.Twill is X but ServerScriptService.Twill is Y; ... | The two modules come from different releases. |
Requiring modules
Section titled “Requiring modules”Each side has one way in. Both hand back the same table on the server, which resolves modules lazily, so one require reaches everything and a module you never name costs nothing.
-- In a server script:local Twill = require("@game/ServerScriptService/Twill")
Twill.Data -- server onlyTwill.Kits.Trade -- the server half of a kit
-- In a client script:local Twill = require("@game/ReplicatedStorage/Twill")
Twill.Log -- sharedTwill.Kits.Trade -- the client half of the same kitRequiring a module directly works too, and is the better choice inside a client module that must not wait.
local Log = require("@game/ReplicatedStorage/Twill/Log")local Token = require("@game/ServerScriptService/Twill/Token")Naming a server-only module from a client fails at the require rather than
handing back a nil that surfaces somewhere else much later:
[Twill] 'Data' is not a Twill module, or is server onlyQuick start boots a server, saves a player’s data, and prints a line when a player is ready.