Twilight Elevatorspaidv1.1.0Qbox

Installation & Config

Get Twilight Elevators running and add your own buildings.

Installation

Download the resource

Download twilight-elevators from your CFX Portal granted assets and place it in your resources folder.

Start it after its dependencies

Add it to your server.cfg below the resources it depends on.

server.cfg
ensure oxmysql
ensure ox_lib
ensure ox_target
ensure xsound
ensure qbx_core
ensure twilight-elevators

General Settings

All options live in config.lua.

OptionTypeDefaultDescription
Config.DebugbooleanfalseDraws the target zones so you can line up panels.
Config.VersionCheckbooleantruePrints whether you are on the latest version at startup.
Config.CooldownMsnumber2500Time in ms before a player can open a panel again.
Config.TravelTimenumber2500Length of the travel progress bar in ms.
Config.UseSoundsbooleantruePlays the arrival chime through xsound.
Config.UIPrimaryColorstring'#6D28D9'Accent colour of the floor selector.
Config.UITiltEnabledbooleantrueSet to false for a flat panel.
Config.UITiltnumber15How far the panel leans away from the screen.

Admin Menu Settings

OptionTypeDefaultDescription
Config.Admin.Commandstring'elevatoradmin'Command that opens the admin menu.
Config.Admin.Acestring'twilight.elevators.admin'Ace that grants access to the admin menu.
Config.Admin.Groupsstring[]{ 'admin', 'god' }Qbox groups that can use the admin menu.
Config.Admin.LogWebhookstring''Discord webhook for a permanent log of admin changes.

Adding an Elevator

You can build elevators in game with the admin menu, or add them to config.lua by hand. Each entry in Config.Elevators is one elevator. A panel is where players interact, and a floor is where they arrive.

config.lua
Config.Elevators = {
    ["mission_row_main"] = {
        label = "Mission Row Police Department",
        groupId = "mrpd",
 
        panels = {
            { coords = vec3(456.03, -988.37, 30.40), size = vec3(1.2, 1.2, 2.2), heading = 340.0 },
        },
 
        floors = {
            {
                id = "pd_main_floor",
                label = "Main Floor",
                order = 1,
                coords = vec4(457.16, -989.52, 30.27, 89.50),
                allowedJobs = { "police" },
            },
        },
    },
}

Floor Options

OptionTypeDefaultDescription
idstringrequiredUnique id for the floor.
labelstringrequiredName shown in the floor selector.
ordernumberrequiredPosition of the floor in the selector.
coordsvec4requiredWhere the player arrives, including heading.
allowedJobsstring[]nilJobs allowed to travel here. Leave out for public floors.
Linked elevators

Give two elevators in the same building the same groupId and they will share the player's current floor, so either lift knows where they are.