Getting Started
Choose a Frontend
NetRay Compiler currently supports two frontend workflows:
- Studio Plugin for in-Studio compilation into
ReplicatedStorage - Standalone CLI for filesystem-based generation through Rokit
Installation
Option 1: Studio Plugin
Get the Plugin
Open the NetRay Compiler Plugin on the Roblox Creator Store and click Get.
Open in Studio
Launch Roblox Studio, open the Plugins tab, and look for the NetRay toolbar.
Launch Interface
Click the NetRayCompiler button to open the compiler interface window.
Option 2: Standalone CLI
Install with Rokit
shrokit add AstaWasTaken/NetRay-Compile@<version> netrayCompile a schema
shnetray compile path/to/schema.idl --out-dir generated --scope NetRayUse the generated modules
The CLI writes:
generated/Server.luaugenerated/Client.luaugenerated/Types.luau
Your First Schema
In the Scope Name field, enter a name for your network definition (e.g.,
NetRay). -- Can be left empty.Paste the following example into the editor:
rust// A simple reliable event event reliable Greet { From: Client, Data: string, }Click Compile to ReplicatedStorage.
Generated Assets
If successful, the plugin creates a folder structure in ReplicatedStorage:
ReplicatedStorage/NetRay/ServerReplicatedStorage/NetRay/ClientReplicatedStorage/NetRay/TypesReplicatedStorage/NetRay/Schema
Understanding Scopes
The Scope Name you enter (e.g., Combat) determines the names of the underlying RemoteEvents:
Combat_RELIABLECombat_UNRELIABLECombat_FUNCTION
Example Server Script
-- Server
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NetServer = require(ReplicatedStorage.NetRay.Server)
NetServer.Ping.FireAll(os.clock())Example Client Script
-- Client
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NetClient = require(ReplicatedStorage.NetRay.Client)
NetClient.Ping.On(function(ServerClock)
Print("Ping: "..os.clock() - ServerClock)
end)Next Steps
- Learn the standalone CLI Workflow.
- Learn the full IDL Syntax.
- see how to use the generated code in the Using Generated API guide.
