Skip to main content
Doors and elevators are defined in configuration files within mythic-doors/shared/config/. This page covers the data structures and restriction types.

Door Definition

Each door is a table with the following properties:
{
    id = "mrpd_front",           -- Optional string ID for easy reference
    model = 2089009131,          -- GTA model hash
    coords = vector3(434.75, -982.18, 30.71),
    locked = true,               -- Initial lock state
    maxDist = 2.0,               -- Interaction distance
    canLockpick = false,         -- Whether door can be lockpicked
    holdOpen = false,            -- Door stays open when unlocked
    autoRate = 6.0,              -- Auto-close speed
    autoDist = nil,              -- Distance threshold for auto-close
    autoLock = 60,               -- Re-lock after X seconds (nil = no auto-lock)
    double = nil,                -- Index of paired door (for double doors)
    special = nil,               -- Custom property for scripts
    restricted = {               -- Who can lock/unlock this door
        {
            type = 'job',
            job = 'police',
            workplace = 'lspd',
            grade = 'officer',
            gradeLevel = 1,
            reqDuty = true,
            jobPermission = 'door_access'
        }
    }
}

Property Reference

PropertyTypeDefaultDescription
idstringnilNamed identifier for scripting
modelnumberrequiredGTA object model hash
coordsvector3requiredDoor position in world
lockedbooleanfalseInitial lock state
maxDistnumber2.0Max interaction distance
canLockpickbooleanfalseLockpickable
holdOpenbooleanfalseStay open when unlocked
autoRatenumber6.0Auto-close animation speed
autoDistnumbernilAuto-close distance
autoLocknumbernilSeconds until auto re-lock
doublenumbernilPaired door index
specialanynilCustom script data
restrictedtableAccess restrictions

Restriction Types

Job Restriction

Restrict door access to players with a specific job.
{
    type = 'job',
    job = 'police',              -- Required: job identifier
    workplace = 'lspd',          -- Optional: specific workplace
    grade = 'officer',           -- Optional: specific grade name
    gradeLevel = 1,              -- Optional: minimum grade level
    reqDuty = true,              -- Optional: must be on duty
    jobPermission = 'door_access' -- Optional: requires job permission
}
Examples:
-- Any police officer on duty
{ type = 'job', job = 'police', reqDuty = true }

-- LSPD sergeant or higher
{ type = 'job', job = 'police', workplace = 'lspd', gradeLevel = 3 }

-- EMS with specific permission
{ type = 'job', job = 'ems', jobPermission = 'hospital_access' }

-- Any mechanic (on or off duty)
{ type = 'job', job = 'mechanic' }

Character Restriction

Restrict door access to a specific character by State ID.
{
    type = 'character',
    SID = 123                    -- Character State ID
}
Example:
-- Personal office door
restricted = {
    { type = 'character', SID = 42 },
    { type = 'character', SID = 87 }
}

Property Data Restriction

Restrict door access based on property data values.
{
    type = 'propertyData',
    key = 'property_id',         -- Property data field name
    value = 'apt_301'            -- Expected value
}
Example:
-- Door tied to apartment ownership
restricted = {
    { type = 'propertyData', key = 'owner', value = 'property_123' }
}

Multiple Restrictions

A door can have multiple restrictions. A player needs to match any one of them to access the door.
restricted = {
    -- Police can access
    { type = 'job', job = 'police', reqDuty = true },
    -- EMS can also access
    { type = 'job', job = 'ems', reqDuty = true },
    -- Specific character always has access
    { type = 'character', SID = 1 }
}

Double Doors

Link two doors together so locking/unlocking one affects both.
-- Door definitions (using array indices)
[15] = {
    model = 2089009131,
    coords = vector3(434.75, -982.18, 30.71),
    locked = true,
    double = 16,                 -- Points to the other door
    restricted = { { type = 'job', job = 'police' } }
},
[16] = {
    model = 2089009131,
    coords = vector3(434.75, -980.18, 30.71),
    locked = true,
    double = 15,                 -- Points back
    restricted = { { type = 'job', job = 'police' } }
}

Elevator Definition

Elevators are multi-floor transport points with per-floor access control.
{
    id = "mrpd_elevator",
    name = "MRPD Elevator",
    canLock = {                  -- Who can lock/unlock floors
        { type = 'job', job = 'police', gradeLevel = 3 }
    },
    floors = {
        [1] = {
            name = "Ground Floor",
            coords = vector4(434.75, -982.18, 30.71, 180.0),
            defaultLocked = false,
            restricted = {},     -- Who can use this floor
            bypassLock = {},     -- Who bypasses the lock
            zone = {
                center = vector3(434.75, -982.18, 30.71),
                length = 1.5,
                width = 1.5,
                heading = 0,
                minZ = 29.0,
                maxZ = 32.0
            }
        },
        [2] = {
            name = "Offices",
            coords = vector4(434.75, -982.18, 35.71, 180.0),
            defaultLocked = false,
            restricted = {
                { type = 'job', job = 'police' }
            },
            bypassLock = {},
            zone = {
                center = vector3(434.75, -982.18, 35.71),
                length = 1.5,
                width = 1.5,
                heading = 0,
                minZ = 34.0,
                maxZ = 37.0
            }
        },
        [3] = {
            name = "Rooftop",
            coords = vector4(434.75, -982.18, 50.71, 180.0),
            defaultLocked = true,
            restricted = {
                { type = 'job', job = 'police', gradeLevel = 3 }
            },
            bypassLock = {},
            zone = {
                center = vector3(434.75, -982.18, 50.71),
                length = 1.5,
                width = 1.5,
                heading = 0,
                minZ = 49.0,
                maxZ = 52.0
            }
        }
    }
}

Floor Properties

PropertyTypeDescription
namestringFloor display name
coordsvector4Teleport position (x, y, z, heading)
defaultLockedbooleanInitial lock state
restrictedtableAccess restrictions (same types as doors)
bypassLocktableRestrictions that bypass the lock entirely
zonetableInteraction zone definition

Zone Properties

PropertyTypeDescription
centervector3Zone center position
lengthnumberZone length
widthnumberZone width
headingnumberZone rotation
minZnumberZone minimum height
maxZnumberZone maximum height

Next Steps

Doors - Exports

Door API methods

Jobs API

Job system for restrictions

Admin Callbacks

Admin door management