Skip to main content

Remoting

Offers a thin wrapper around Roblox remoting instances and events. Designed to reduce the amount of code needed to construct a large set of RemoteFunction/RemoteEvent instances.

Functions​

new​

Remoting.new(
instance: Instance,
name: string,
remotingRealm: RemotingRealm?
) → Remoting

Creates a new remoting instance

Connect​

Remoting.Connect(
self: Remoting,
memberName: string,
callback: (...) → ()
) → MaidTask

Connects to a given remote event.

Bind​

Remoting.Bind(
self: Remoting,
memberName: string,
callback: any
) → Maid.Maid

If on the server, creates a new RemoteFunction with the name memberName and binds the invoke. On the client, it waits for the function to exist and then binds to it.

DeclareEvent​

Remoting.DeclareEvent(
self: Remoting,
memberName: string
) → ()

Forward declares an event on the remoting object

DeclareMethod​

Remoting.DeclareMethod(
self: Remoting,
memberName: string
) → ()

Forward declares a method on the remoting object

FireClient​

Remoting.FireClient(
self: Remoting,
memberName: string,
player: Player,
...: any
) → ()

Fires the client with the individual request. Should consider this syntax instead.

local remoting = Remoting.new(workspace, "Test")
remoting.Event:FireClient(otherPlayer, ...)

Equivalent of RemoteEvent:FireClient.

InvokeClient​

This item only works when running on the server. Server
Remoting.InvokeClient(
self: Remoting,
memberName: string,
player: Player,
...: any
) → ()

Invokes the client, yielding as needed

Equivalent of RemoteFunction.InvokeClient.

FireAllClients​

This item only works when running on the server. Server
Remoting.FireAllClients(
self: Remoting,
memberName: string,
...: any
) → ()

Fires all clients with the event.

Equivalent of RemoteEvent:FireAllClients.

FireAllClientsExcept​

This item only works when running on the server. Server
Remoting.FireAllClientsExcept(
self: Remoting,
memberName: string,
excludePlayer: Player | nil,
...: any
) → ()

Fires all clients with the event except the excluded player. The excluded player may be nil to support NPC actions.

FireServer​

This item only works when running on the client. Client
Remoting.FireServer(
self: Remoting,
memberName: string,
...: any
) → ()

Fires the server

PromiseFireServer​

This item only works when running on the client. Client
Remoting.PromiseFireServer(
self: Remoting,
memberName: string,
...: any
) → Promise

Fires the server, resolving the promise once it is fired.

InvokeServer​

This item only works when running on the client. Client
Remoting.InvokeServer(
self: Remoting,
memberName: string,
...: any
) → any

Invokes the server from the client

PromiseInvokeServer​

This item only works when running on the client. Client
Remoting.PromiseInvokeServer(
self: Remoting,
memberName: string,
...: any
) → Promise<...any>

Invokes the server from the client

PromiseInvokeClient​

This item only works when running on the server. Server
Remoting.PromiseInvokeClient(
self: Remoting,
memberName: string,
player: Player,
...: any
) → Promise<any>

Invokes the client from the server

Destroy​

Remoting.Destroy(self: Remoting) → ()

Cleans up the remoting object

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new remoting instance",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "remotingRealm",
                    "desc": "",
                    "lua_type": "RemotingRealm?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Remoting"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 130,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "Connect",
            "desc": "Connects to a given remote event.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "(...) -> ()"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "MaidTask"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 167,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "Bind",
            "desc": "If on the server, creates a new [RemoteFunction] with the name `memberName` and binds the\ninvoke. On the client, it waits for the function to exist and then binds to it.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Maid.Maid\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 242,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "DeclareEvent",
            "desc": "Forward declares an event on the remoting object",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 316,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "DeclareMethod",
            "desc": "Forward declares a method on the remoting object",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 334,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "FireClient",
            "desc": "Fires the client with the individual request. Should consider this syntax instead.\n\n```lua\nlocal remoting = Remoting.new(workspace, \"Test\")\nremoting.Event:FireClient(otherPlayer, ...)\n```\n\nEquivalent of [RemoteEvent:FireClient].",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 412,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "InvokeClient",
            "desc": "Invokes the client, yielding as needed\n\nEquivalent of [RemoteFunction.InvokeClient].",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "static",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 444,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "FireAllClients",
            "desc": "Fires all clients with the event.\n\nEquivalent of [RemoteEvent:FireAllClients].",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "static",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 468,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "FireAllClientsExcept",
            "desc": "Fires all clients with the event except the excluded player. The excluded player may be nil to support\nNPC actions.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "excludePlayer",
                    "desc": "",
                    "lua_type": "Player | nil"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "static",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 492,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "FireServer",
            "desc": "Fires the server",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "static",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 528,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "PromiseFireServer",
            "desc": "Fires the server, resolving the promise once it is fired.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise"
                }
            ],
            "function_type": "static",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 553,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "InvokeServer",
            "desc": "Invokes the server from the client",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 598,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "PromiseInvokeServer",
            "desc": "Invokes the server from the client",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<...any>"
                }
            ],
            "function_type": "static",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 612,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "PromiseInvokeClient",
            "desc": "Invokes the client from the server",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                },
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<any>"
                }
            ],
            "function_type": "static",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 662,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Cleans up the remoting object",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Remoting"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 850,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Remoting",
    "desc": "Offers a thin wrapper around Roblox remoting instances and events. Designed to reduce\nthe amount of code needed to construct a large set of RemoteFunction/RemoteEvent instances.",
    "source": {
        "line": 8,
        "path": "src/remoting/src/Shared/Interface/Remoting.lua"
    }
}