Skip to content

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

  1. Get the Plugin

    Open the NetRay Compiler Plugin on the Roblox Creator Store and click Get.

  2. Open in Studio

    Launch Roblox Studio, open the Plugins tab, and look for the NetRay toolbar.

  3. Launch Interface

    Click the NetRayCompiler button to open the compiler interface window.

Option 2: Standalone CLI

  1. Install with Rokit

    sh
    rokit add AstaWasTaken/NetRay-Compile@<version> netray
  2. Compile a schema

    sh
    netray compile path/to/schema.idl --out-dir generated --scope NetRay
  3. Use the generated modules

    The CLI writes:

    • generated/Server.luau
    • generated/Client.luau
    • generated/Types.luau

Your First Schema

  1. In the Scope Name field, enter a name for your network definition (e.g., NetRay). -- Can be left empty.

  2. Paste the following example into the editor:

    rust
    // A simple reliable event
    event reliable Greet {
        From: Client,
        Data: string,
    }
  3. Click Compile to ReplicatedStorage.

Generated Assets

If successful, the plugin creates a folder structure in ReplicatedStorage:

  • ReplicatedStorage/NetRay/Server
  • ReplicatedStorage/NetRay/Client
  • ReplicatedStorage/NetRay/Types
  • ReplicatedStorage/NetRay/Schema

Understanding Scopes

The Scope Name you enter (e.g., Combat) determines the names of the underlying RemoteEvents:

  • Combat_RELIABLE
  • Combat_UNRELIABLE
  • Combat_FUNCTION

Example Server Script

luau
-- Server
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NetServer = require(ReplicatedStorage.NetRay.Server)

NetServer.Ping.FireAll(os.clock())

Example Client Script

luau
-- 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

NetRay Compiler docs. Supported frontends: Roblox Studio plugin and standalone CLI.