Version: 2.1.5

Getting started

What are definitions?#

Definitions are a sort of "blueprint" for all the networking related objects in your game or library.

It's a single source of truth in which all the code in your game can access remotes through, to handle your game or library's networking.

Creating a definition script#

To use definitions, you will need to create a script that is somewhere in ReplicatedStorage (or inside the library itself if you're doing it for a library). It needs to be accessible by both server scripts and client scripts.

The basic declaration of a definition script, is the following:

shared/remotes.ts
import Net from "@rbxts/net";
const Remotes = Net.Definitions.Create({
// Definitions for the actual remotes will go here
});
export = Remotes;

Then simply, you can import the module from your code, and use the definitions API to get the remotes