Skip to main content

ClientEvent

Functions

new

ClientEvent.new(instanceRemoteEvent) → ClientEvent

Fire

ClientEvent:Fire(...any) → ()

Fires the underlying event to the server

AddMiddleware

since v1.1.0
</>
ClientEvent:AddMiddleware(fnMiddlewareFn) → ()

Add a middleware function to run after the event is fired

SetCallback

ClientEvent:SetCallback(
expects{TypeCheckFunc},--

What is expected from the server

callback(...any) → ()
) → Connection

Sets the callback for the event.

Predict

ClientEvent:Predict(...any) → ()

Fires an event from the client to client, this would be the same as firing a BindableEvent

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "RemoteEvent"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ClientEvent"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 32,
                "path": "Source/Networking/Classes/Client.luau"
            }
        },
        {
            "name": "Fire",
            "desc": "Fires the underlying event to the server",
            "params": [
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 47,
                "path": "Source/Networking/Classes/Client.luau"
            }
        },
        {
            "name": "AddMiddleware",
            "desc": "Add a middleware function to run after the event is fired",
            "params": [
                {
                    "name": "fn",
                    "desc": "",
                    "lua_type": "MiddlewareFn"
                }
            ],
            "returns": [],
            "function_type": "method",
            "since": "v1.1.0",
            "source": {
                "line": 59,
                "path": "Source/Networking/Classes/Client.luau"
            }
        },
        {
            "name": "SetCallback",
            "desc": "Sets the callback for the event.",
            "params": [
                {
                    "name": "expects",
                    "desc": "What is expected from the server",
                    "lua_type": "{TypeCheckFunc}"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "(...any) -> ()"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Connection"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 72,
                "path": "Source/Networking/Classes/Client.luau"
            }
        },
        {
            "name": "Predict",
            "desc": "Fires an event from the client to client, this would be the same as firing a `BindableEvent`",
            "params": [
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 127,
                "path": "Source/Networking/Classes/Client.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ClientEvent",
    "desc": "",
    "source": {
        "line": 9,
        "path": "Source/Networking/Classes/Client.luau"
    }
}