Skip to main content

Networker

A wrapper for Roblox RemoteEvents and UnreliableRemoteEvents that integrates with the Encoder module for automatic serialization and deserialization of data.

Functions

getRemote

Networker.getRemote(
eventRemoteInstance--

The remote instance to wrap.

) → NetworkerType--

The Networker instance.

Types

interface NetworkerType {
remoteInstanceRemoteInstance--

The underlying RemoteEvent or UnreliableRemoteEvent.

FireServer(
...any
) → ()--

Sends data to the server (lossless).

FireServerLossy(
...any
) → ()--

Sends data to the server (lossy).

FireClient(
playerPlayer,
...any
) → ()--

Sends data to a specific client (lossless).

FireClientLossy(
playerPlayer,
...any
) → ()--

Sends data to a specific client (lossy).

FireAllClients(
...any
) → ()--

Sends data to all clients (lossless).

FireAllClientsLossy(
...any
) → ()--

Sends data to all clients (lossy).

Connect(
callback(...any) → ()
) → RBXScriptConnection--

Connects a listener to the event.

}

Returns a Networker instance for the given RemoteEvent or UnreliableRemoteEvent. Caches the instance to ensure singleton behavior per event.

FireServer

Networker:FireServer(
...any--

Data to send.

) → ()

Fires the remote event to the server losslessly.

FireServerLossy

Networker:FireServerLossy(
...any--

Data to send.

) → ()

Fires the remote event to the server with lossy compression.

FireClient

This item only works when running on the server. Server
Networker:FireClient(
playerPlayer,--

The target player.

...any--

Data to send.

) → ()

Fires the remote event to a specific client losslessly.

FireClientLossy

This item only works when running on the server. Server
Networker:FireClientLossy(
playerPlayer,--

The target player.

...any--

Data to send.

) → ()

Fires the remote event to a specific client with lossy compression.

FireAllClients

This item only works when running on the server. Server
Networker:FireAllClients(
...any--

Data to send.

) → ()

Fires the remote event to all connected clients losslessly.

FireAllClientsLossy

This item only works when running on the server. Server
Networker:FireAllClientsLossy(
...any--

Data to send.

) → ()

Fires the remote event to all connected clients with lossy compression.

Connect

Networker:Connect(
callback(...any) → ()--

The function to call when the event is received.

) → RBXScriptConnection--

The event connection.

Connects a listener to the remote event. Automatically decodes incoming buffer data.

Show raw api
{
    "functions": [
        {
            "name": "getRemote",
            "desc": "Returns a Networker instance for the given RemoteEvent or UnreliableRemoteEvent.\nCaches the instance to ensure singleton behavior per event.",
            "params": [
                {
                    "name": "event",
                    "desc": "The remote instance to wrap.",
                    "lua_type": "RemoteInstance"
                }
            ],
            "returns": [
                {
                    "desc": "The Networker instance.",
                    "lua_type": "NetworkerType"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 51,
                "path": "global/ReplicatedStorage/Scripts/Modules/Networker.luau"
            }
        },
        {
            "name": "FireServer",
            "desc": "Fires the remote event to the server losslessly.",
            "params": [
                {
                    "name": "...",
                    "desc": "Data to send.",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 78,
                "path": "global/ReplicatedStorage/Scripts/Modules/Networker.luau"
            }
        },
        {
            "name": "FireServerLossy",
            "desc": "Fires the remote event to the server with lossy compression.",
            "params": [
                {
                    "name": "...",
                    "desc": "Data to send.",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 96,
                "path": "global/ReplicatedStorage/Scripts/Modules/Networker.luau"
            }
        },
        {
            "name": "FireClient",
            "desc": "Fires the remote event to a specific client losslessly.",
            "params": [
                {
                    "name": "player",
                    "desc": "The target player.",
                    "lua_type": "Player"
                },
                {
                    "name": "...",
                    "desc": "Data to send.",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 116,
                "path": "global/ReplicatedStorage/Scripts/Modules/Networker.luau"
            }
        },
        {
            "name": "FireClientLossy",
            "desc": "Fires the remote event to a specific client with lossy compression.",
            "params": [
                {
                    "name": "player",
                    "desc": "The target player.",
                    "lua_type": "Player"
                },
                {
                    "name": "...",
                    "desc": "Data to send.",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 136,
                "path": "global/ReplicatedStorage/Scripts/Modules/Networker.luau"
            }
        },
        {
            "name": "FireAllClients",
            "desc": "Fires the remote event to all connected clients losslessly.",
            "params": [
                {
                    "name": "...",
                    "desc": "Data to send.",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 155,
                "path": "global/ReplicatedStorage/Scripts/Modules/Networker.luau"
            }
        },
        {
            "name": "FireAllClientsLossy",
            "desc": "Fires the remote event to all connected clients with lossy compression.",
            "params": [
                {
                    "name": "...",
                    "desc": "Data to send.",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 174,
                "path": "global/ReplicatedStorage/Scripts/Modules/Networker.luau"
            }
        },
        {
            "name": "Connect",
            "desc": "Connects a listener to the remote event. Automatically decodes incoming buffer data.",
            "params": [
                {
                    "name": "callback",
                    "desc": "The function to call when the event is received.",
                    "lua_type": "(...any) -> ()"
                }
            ],
            "returns": [
                {
                    "desc": "The event connection.",
                    "lua_type": "RBXScriptConnection"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 193,
                "path": "global/ReplicatedStorage/Scripts/Modules/Networker.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "NetworkerType",
            "desc": "",
            "fields": [
                {
                    "name": "remoteInstance",
                    "lua_type": "RemoteInstance",
                    "desc": "The underlying RemoteEvent or UnreliableRemoteEvent."
                },
                {
                    "name": "FireServer",
                    "lua_type": "(self: NetworkerType, ...any) -> ()",
                    "desc": "Sends data to the server (lossless)."
                },
                {
                    "name": "FireServerLossy",
                    "lua_type": "(self: NetworkerType, ...any) -> ()",
                    "desc": "Sends data to the server (lossy)."
                },
                {
                    "name": "FireClient",
                    "lua_type": "(self: NetworkerType, player: Player, ...any) -> ()",
                    "desc": "Sends data to a specific client (lossless)."
                },
                {
                    "name": "FireClientLossy",
                    "lua_type": "(self: NetworkerType, player: Player, ...any) -> ()",
                    "desc": "Sends data to a specific client (lossy)."
                },
                {
                    "name": "FireAllClients",
                    "lua_type": "(self: NetworkerType, ...any) -> ()",
                    "desc": "Sends data to all clients (lossless)."
                },
                {
                    "name": "FireAllClientsLossy",
                    "lua_type": "(self: NetworkerType, ...any) -> ()",
                    "desc": "Sends data to all clients (lossy)."
                },
                {
                    "name": "Connect",
                    "lua_type": "(self: NetworkerType, callback: (...any) -> ()) -> RBXScriptConnection",
                    "desc": "Connects a listener to the event."
                }
            ],
            "source": {
                "line": 30,
                "path": "global/ReplicatedStorage/Scripts/Modules/Networker.luau"
            }
        }
    ],
    "name": "Networker",
    "desc": "A wrapper for Roblox RemoteEvents and UnreliableRemoteEvents that integrates with the Encoder module \nfor automatic serialization and deserialization of data.",
    "source": {
        "line": 11,
        "path": "global/ReplicatedStorage/Scripts/Modules/Networker.luau"
    }
}