A floor-level restriction limits access to specific floors of an elevator or elevators. If the restriction check returns false, the specified floors become inaccessible while others remain accessible.
You can find all of the examples in no-elevators/restrictions/examples folder.
Example
local API = exports["no-elevators"]localfunctionisAdmin(source)returnIsPlayerAceAllowed(source, "elevators.admin")end--In this example:-- admin, admin2, admin3, and admin4 are elevator IDs.-- Each floor list (e.g., {1, 2, 3} or 1) defines the restricted floors by their index.-- isAdmin determines whether the user has access.---@param floors table<string, table<number> | number>---@param controller fun -> booleanAPI:AddFloorRestriction({ admin = {1, 2, 3}, admin2 = {1, 2, 3}, admin3 = {1, 2, 3}, admin4 =1}, isAdmin)--------------------------------------------------------------------------------------------------------------In this example:-- "admin2" is the elevator ID.-- 1 or {2, 3, 4} specifies the restricted floors by their index.-- isAdmin determines whether the user has access.---@param elevatorId string---@param floors table<number> | number---@param controller fun -> booleanAPI:AddFloorRestriction("admin2", 1, isAdmin)API:AddFloorRestriction("admin2", {2, 3, 4}, isAdmin)