Skip to main content

Restraint

Base class for restraints. Manages the locking and unlocking of occupants in a seat.

Properties

serverData

Restraint.serverData: Instance

Instance where data used for syncing is stored.

maid

Restraint.maid: Maid

rideSeats

Restraint.rideSeats: {RideSeat}

See RideSeat

model

Restraint.model: Model

The model for the restraint

onIsOpenChanged

Signal
Restraint.onIsOpenChanged: Signal<(isOpenboolean) → nil>

Fires when isOpen changes

onIsLockedChanged

Signal
Restraint.onIsLockedChanged: Signal<(isLockedboolean) → nil>

Fires when isLocked changes

Functions

new

Constructor
Restraint.new(
rideSeats{RideSeat} | RideSeat,
modelModel
) → Restraint

Destroy

Deconstructor
Restraint:Destroy() → ()

isOpen

Restraint:isOpen() → boolean

Returns whether this restraint is open or not

isSeatOpen

Restraint:isSeatOpen() → boolean

Returns whether any seat controlled by this restraint is open or not

isLocked

Restraint:isLocked() → boolean

Returns whether this restraint is locked or not If isLocked, restraint cannot be moved

setIsOpen

Restraint:setIsOpen(valueboolean) → ()

Sets whether this is open or not If isLocked, isOpen cannot be changed

setIsLocked

Restraint:setIsLocked(valueboolean) → ()

Sets whether this is locked or not

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "rideSeats",
                    "desc": "",
                    "lua_type": "{RideSeat} | RideSeat"
                },
                {
                    "name": "model",
                    "desc": "",
                    "lua_type": "Model"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Restraint"
                }
            ],
            "function_type": "static",
            "tags": [
                "Constructor"
            ],
            "source": {
                "line": 40,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "method",
            "tags": [
                "Deconstructor"
            ],
            "source": {
                "line": 70,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "_updateIsOpen",
            "desc": "Updates whether Restraint isOpen",
            "params": [],
            "returns": [],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 79,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "isOpen",
            "desc": "Returns whether this restraint is open or not",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 94,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "isSeatOpen",
            "desc": "Returns whether any seat controlled by this restraint is open or not",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 99,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "isLocked",
            "desc": "Returns whether this restraint is locked or not\nIf isLocked, restraint cannot be moved",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 111,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "setIsOpen",
            "desc": "Sets whether this is open or not\nIf isLocked, isOpen cannot be changed",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 118,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "setIsLocked",
            "desc": "Sets whether this is locked or not",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 133,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "serverData",
            "desc": "Instance where data used for syncing is stored.",
            "lua_type": "Instance",
            "source": {
                "line": 10,
                "path": "src/shared/plugins/restraint/Restraint_Server.lua"
            }
        },
        {
            "name": "maid",
            "desc": "",
            "lua_type": "Maid",
            "source": {
                "line": 13,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "rideSeats",
            "desc": "See RideSeat",
            "lua_type": "{RideSeat}",
            "source": {
                "line": 17,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "model",
            "desc": "The model for the restraint",
            "lua_type": "Model",
            "source": {
                "line": 21,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "onIsOpenChanged",
            "desc": "Fires when isOpen changes",
            "lua_type": "Signal<(isOpen: boolean) -> nil>",
            "tags": [
                "Signal"
            ],
            "source": {
                "line": 26,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        },
        {
            "name": "onIsLockedChanged",
            "desc": "Fires when isLocked changes",
            "lua_type": "Signal<(isLocked: boolean) -> nil>",
            "tags": [
                "Signal"
            ],
            "source": {
                "line": 31,
                "path": "src/shared/plugins/restraint/Restraint.lua"
            }
        }
    ],
    "types": [],
    "name": "Restraint",
    "desc": "Base class for restraints.\nManages the locking and unlocking of occupants in a seat.",
    "source": {
        "line": 10,
        "path": "src/shared/plugins/restraint/Restraint.lua"
    }
}