> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nonefivem.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Elevator Restriction

An elevator-level restriction disables **all floors** of the elevator if the condition evaluates to `false`. This type of restriction ensures that users are entirely restricted from using the elevator.

<Info>You can find all of the examples in `no-elevators/restrictions/examples` folder.</Info>

### Example

***

```lua theme={null}
local API = exports["no-elevators"]
local function isAdmin(source)
    return IsPlayerAceAllowed(source, "elevators.admin")
end
--In these examples:
-- "admin" refers to the elevator ID.
-- {"admin", "admin2", "admin3"} applies the restriction to multiple elevators.
-- isAdmin serves as the controller function, returning true or false.
-- Apply restriction to a single elevator
---@param elevatorIds table<string> | string
---@param controller fun -> boolean
API:AddElevatorRestriction("admin", isAdmin)
-- Apply restriction to multiple elevators
---@param elevatorIds table<string> | string
---@param controller fun -> boolean
API:AddElevatorRestriction({"admin", "admin2", "admin3"}, isAdmin)
```
