Skip to main content
Flux has two entry points. Call Flux.Server(name) on the server and Flux.Client(name) on the client with the same name, and the two objects are connected.
The name is the channel identifier. It is written into every packet as a length-prefixed string, so both sides have to agree on it exactly. Matching is case-sensitive.

Server example

ServerScriptService/Example.server.luau

Client example

StarterPlayerScripts/Example.client.luau

Reliable and unreliable delivery

Every Flux event carries both channels. There is no second object to create, so pick the method that matches the message.
Unreliable packets are subject to Roblox’s UnreliableRemoteEvent size limit. Keep them to a single small payload, such as a CFrame or a couple of numbers, and never rely on them arriving.

Client-to-server invocations

An invocation is a round trip. The client sends a request, the server’s OnInvoke handler runs, and its return values come back to the caller.
Client:Invoke errors if the server handler errors or if the request times out, so wrap it when failure is expected:
Invocations only run from client to server. The server has no Invoke method and the client has no OnInvoke property. See Invocations for the pattern to use when you need data from a client.

Adding a schema

Passing a schema replaces the dynamic encoder with a fixed layout. It removes the per-value type tag from every argument and narrows numbers to the width you declare.
Declare the same schema on both sides, then read on for the full rules.

Schemas

Fixed layouts, composites, and when they pay off.

Generics

Get real autocomplete on Fire, Connect and Invoke.