Cheat Sheet, Types & API Tables
The quick-lookup page: server/client differences, exported types, testing, common errors, and every function in one place.
Server vs. Client Cheat Sheet
The single most important thing to internalize: the server and every client
each run their own separate instance of Thread's internal state
(Thread._Register, its own start Promise, etc.) — they are
different Lua VMs entirely. Nothing about a service you create on the server is
automatically visible to Thread.GetService on the client, or vice versa.
Channel is the only bridge between the two.
| I want to... | On the server | On the client |
|---|---|---|
| Define a service/controller | Thread.CreateService({...}) | Thread.CreateService({...}) (same call, informally called a "controller") |
| Expose something to clients | Give the service a Client = {...} table | — (nothing to expose from one client to others) |
| Get one of MY OWN registered services | Thread.GetService("X") | Thread.GetService("X") |
| Get a server service's Client API | — (already has direct access) | Channel.BuildClient("X") — never Thread.GetService |
| Fire a signal | self.Client.MySignal:Fire(player, ...) / :FireAll(...) / :FireExcept(p, ...) | proxy.MySignal:Fire(...) (server inferred) |
| Read/set a property | :Get() / :Set(v) / :SetFor(p, v) / :GetFor(p) / :ClearFor(p) | :Get() / :Observe(fn) only |
[Thread] No service named 'ArrestService' is registered
This means you called Thread.GetService("ArrestService") on the
client, but ArrestService was only ever created on the server. Use
Channel.BuildClient("ArrestService") instead.
Exported Luau Types
Every module is written under --!strict and exports its own types, so if
your own code also uses --!strict (or just wants editor autocomplete),
you can reference them directly off the required module:
local Thread = require(game:GetService("ReplicatedStorage").Packages.Thread)
local def: Thread.ServiceDef = {
Name = "MoneyService",
Client = { ... },
}
local MoneyService = Thread.CreateService(def)
| Type | From | Shape |
|---|---|---|
Thread.ServiceDef / Thread.Service | Thread | Client entries, dependencies, middleware, remote policies, limits, and all three lifecycle hooks. |
Thread.RegisterResult | Thread | { Module: ModuleScript, Success: boolean, Result: any, Error: any } |
Thread.Middleware | Thread (re-exported from Channel) | { Inbound: MiddlewareList?, Outbound: MiddlewareList? } |
Channel.MiddlewareFn | Channel | (player: Player, args: {any}) -> boolean |
Channel.WrapOptions | Channel | Middleware, remote policies, rate limits, payload limits, and deferred readiness. |
Channel.RemotePolicy / Channel.RemoteError | Channel | Per-remote validation rules and structured Method failures. |
Promise.Promise<T> | Promise | The Promise type itself. |
Signal.Signal / Signal.Connection | Util/Signal | The Util Signal's own types. |
Trove.Trackable / Trove.SignalLike | Util/Trove | What kinds of values Trove:Add/:Connect accept. |
Option.Option<T> / Option.MatchTable<T> | Util/Option | The Option type and the shape :Match({...}) expects. |
EnumList.EnumList / EnumList.EnumItem | Util/EnumList | The EnumList type and the shape of one of its items. |
Testing
A tiny, dependency-free test runner lives under Tests/ (no TestEZ, no
Wally — just pcall + assert).
- Put the contents of
src/underReplicatedStorage/Packagesand putTests/underServerScriptService/Tests. - Start a Play/Test session in Studio, then paste into the Command Bar:
require(game.ServerScriptService.Tests["Thread.spec"]) - Read the Output window —
[PASS]/[FAIL]per test case, with a summary line at the end.
Troubleshooting
No service named 'X' is registered
You're calling Thread.GetService for a service that isn't registered on that side. If X is a server-only service and you're on the client, use Channel.BuildClient("X") instead.
Remote/service marker timeout errors
'<Name>' does not exist after waiting <N>s / Service '<Name>' never became ready means the service name is misspelled, the service has no Client table, or that service failed during server startup. Channel.BuildClient already waits for server readiness.
A critical service's failure didn't crash my script
That's the default, intentional behavior. Handle it via Thread.Start():catch(...), or opt back into the old behavior with Thread.Configure({ HaltOnCriticalFailure = true }).
Rate limit warnings in the output
A player is calling a Method/Signal faster than the configured limit — either legitimate rapid input (raise the limit via RateLimit/InvokeRateLimit) or exploit/spam attempts (leave it, that's the protection working).
Duplicate service name error
Two different ModuleScripts called Thread.CreateService({ Name = "X" }) with the same name — names must be unique per side.
Full API Reference — Thread
| Function | Description |
|---|---|
Thread.CreateService(def) | Registers a service, lifecycle hooks, networking rules, and dependencies. |
Thread.GetService(name) | Returns a registered service (this side's registry) or errors. |
Thread.GetServices() | Returns a copy of the full service registry. |
Thread.Unregister(name) | Removes a service before Start(). |
Thread.Register(folder, recursive?) | Requires every ModuleScript under folder; returns a results report. |
Thread.Start() | Binds Client remotes, runs ThreadInit then ThreadStart in dependency order. Returns the start Promise. |
Thread.OnStart() | Returns an independent observer Promise for startup, safe to call any time. |
Thread.Stop() / Thread.OnStop() | Stops services in reverse dependency order and destroys networking state. |
Thread.GetServiceStatus(name) | Returns the service's current lifecycle state. |
Thread.Configure({ Debug, HaltOnCriticalFailure }) | Central configuration. |
Thread.CreateSignal() / Thread.CreateUnreliableSignal() / Thread.CreateProperty(v) | Markers for use inside a service's Client table. |
Thread.Version | Current version string. |
Thread.Channel | Direct access to the Channel module. |
Thread.Signal / .Trove / .TableUtil / .Option / .EnumList / .MathUtil / .TimerUtil | Direct access to the Util modules. |
Full API Reference — Channel
| Function | Description |
|---|---|
Channel.WrapService(name, clientTable, opts?) | Server-only. Binds a Client table to real Remotes. Called automatically by Thread.Start(). |
Channel.BuildClient(name, timeout?) | Client-only. Returns a proxy for a wrapped service. |
Channel.GetServiceManifest(name) | Returns a copy of the exact Remote manifest. |
Channel.DecodeResponse(value) / Channel.IsRemoteError(value) | Decodes service Method responses and identifies structured errors. |
Channel.Destroy(name) | Removes every Remote created for a service. |
Channel.On/FireClient/FireAll/FireServer/SetFunction/InvokeServer/InvokeClient/Event/Function | Low-level, string-keyed API. |
Channel.Configure({...}) | Bulk-set Channel.Debug, Channel.DefaultRateLimit, etc. |
Full API Reference — Property
| Method | Where | Description |
|---|---|---|
:Get() | both | Client: last received value. Server: the shared default. |
:Set(value) | server | Sets the default and broadcasts to every client without an override. |
:SetFor(player, value) | server | Sets a value visible only to player. |
:GetFor(player) | server | Reads player's override, or the default if none. |
:ClearFor(player) | server | Removes player's override. |
:Observe(fn) | client | Calls fn immediately and on every change; returns a {Disconnect} handle. |
:Destroy() | server | Disconnects the internal PlayerRemoving connection. |
Full API Reference — Signal (Client-table version)
| Method | Where | Description |
|---|---|---|
:Fire(...) | both | Server: :Fire(player, ...) to one client. Client: :Fire(...) to the server. |
:FireAll(...) | server | To every client. |
:FireExcept(player, ...) | server | To every client except player. |
:Connect(fn) | both | Server handler gets (player, ...); client handler gets (...). |
:Destroy() | both | Disconnects/destroys the underlying Remote. |
This is a different Signal class from the standalone Util/Signal.luau
— same name, but one is Remote-backed (this one) and the other is pure in-process pub/sub.
See the Util Modules page for that one.
See Promise and Util Modules for their complete references, and the CHANGELOG for version history.