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(
instanceInstance,
namestring,
remotingRealmRemotingRealm?
) → Remoting

Creates a new remoting instance

Connect

Remoting:Connect(
memberNamestring,
callbackstring
) → MaidTask

Connects to a given remote event.

Bind

Remoting:Bind(
memberNamestring,
callbackany
) → ()

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

DeclareEvent

Remoting:DeclareEvent(memberNamestring) → ()

Forward declares an event on the remoting object

DeclareMethod

Remoting:DeclareMethod(memberNamestring) → ()

Forward declares an event on the remoting object

FireClient

Remoting:FireClient(
memberNamestring,
playerPlayer,
...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 RemoteFunction.FireClient.

InvokeClient

This item only works when running on the server. Server
Remoting:InvokeClient(
memberNamestring,
playerPlayer,
...any
) → ()

Invokes the client, yielding as needed

Equivalent of RemoteFunction.InvokeClient.

FireAllClients

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

Fires all clients with the event.

Equivalent of RemoteEvent.FireAllClients.

FireAllClientsExcept

This item only works when running on the server. Server
Remoting:FireAllClientsExcept(
memberNamestring,
excludePlayerPlayer | 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(
memberNamestring,
...any
) → ()

Fires the server

PromiseFireServer

This item only works when running on the client. Client
Remoting:PromiseFireServer(
memberNamestring,
...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(
memberNamestring,
...any
) → any

Invokes the server from the client

PromiseInvokeServer

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

Invokes the server from the client

PromiseInvokeClient

This item only works when running on the server. Server
Remoting:PromiseInvokeClient(
memberNamestring,
playerPlayer,
...any
) → Promise<any>

Invokes the client from the server

Destroy

Remoting:Destroy() → ()

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": 62,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "Connect",
            "desc": "Connects to a given remote event.",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "MaidTask"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 99,
                "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 event to exist and then binds to it.",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 165,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "DeclareEvent",
            "desc": "Forward declares an event on the remoting object",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 231,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "DeclareMethod",
            "desc": "Forward declares an event on the remoting object",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 249,
                "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 [RemoteFunction.FireClient].",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 322,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "InvokeClient",
            "desc": "Invokes the client, yielding as needed\n\nEquivalent of [RemoteFunction.InvokeClient].",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 347,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "FireAllClients",
            "desc": "Fires all clients with the event.\n\nEquivalent of [RemoteEvent.FireAllClients].",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 371,
                "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": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "excludePlayer",
                    "desc": "",
                    "lua_type": "Player | nil"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 394,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "FireServer",
            "desc": "Fires the server",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 420,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "PromiseFireServer",
            "desc": "Fires the server, resolving the promise once it is fired.",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise"
                }
            ],
            "function_type": "method",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 435,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "InvokeServer",
            "desc": "Invokes the server from the client",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "method",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 476,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "PromiseInvokeServer",
            "desc": "Invokes the server from the client",
            "params": [
                {
                    "name": "memberName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<any>"
                }
            ],
            "function_type": "method",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 490,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "PromiseInvokeClient",
            "desc": "Invokes the client from the server",
            "params": [
                {
                    "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": "method",
            "realm": [
                "Server"
            ],
            "source": {
                "line": 531,
                "path": "src/remoting/src/Shared/Interface/Remoting.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Cleans up the remoting object",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 710,
                "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": 7,
        "path": "src/remoting/src/Shared/Interface/Remoting.lua"
    }
}