🏜️
Sahara Scripters
  • Welcome
    • Introduction
    • Community & Support
  • Premium Scripts
    • Charging Kiosk
      • Setup Guide
      • Configuration
      • Features
        • Charging System
        • Security
        • Rate Limiting
        • Logging System
        • Phones Management
        • Discord Integration
        • Target System
        • Blip System
        • Translations
      • Integration
        • Inventory Systems
        • Framework Migration
        • Logger Edit
      • Best Practices
      • Troubleshooting
      • Version History
  • Free Scripts
    • Elevator System
      • Setup & Configuration
      • Features Overview
      • Example Buildings
      • Troubleshooting
    • NPWD Renewed Weather APP
    • NPWD QBX Services APP
Powered by GitBook
On this page
  • 📥 Installation
  • 📂 Resource Structure
  • ⚙️ Global Settings (config.lua)
  • 🏢 Building Configuration
  • Example Building (data/buildings/office.lua)
  • Building Registry (data/registry.lua)
  • Access Control Features
  • Customization
  1. Free Scripts
  2. Elevator System

Setup & Configuration

📥 Installation

  1. Download latest release

  2. Place in resources folder

  3. Add to server.cfg:

# Dependencies
ensure ox_lib #Required for elevator system to work

# Other resources (inventory, etc.) depending on your config

# Elevator System
ensure ss_elevator

📂 Resource Structure

ss_elevator/
├── config.lua               # Core settings
├── data/
│   ├── registry.lua        # Building registry
│   └── buildings/          # Building configs
│       ├── building1.lua   # Building config 1
│       └── building2.lua   # Building config 2
├── modules/
│   ├── main/
│   │   ├── client.lua      # Client-side main module
│   │   └── server.lua      # Server-side main module
│   └── ...
├── providers/
│   ├── core/
│   │   ├── provider/        # Core provider module
│   |   │   ├── client.lua   # Client-side provider module
│   |   │   └── server.lua   # Server-side provider module
|   |   ├── qb-core/          # QBCore provider module
|   |   |   ├── client.lua   # Client-side provider module
|   |   |   └── server.lua   # Server-side provider module
|   |   └── qbx_core/        # QBX Core provider module
|   |       ├── client.lua   # Client-side provider module
|   |       └── server.lua   # Server-side provider module
│   └── ...
├── client.lua              # Client-side main script
├── server.lua              # Server-side main script
├── types.lua               # Type definitions
└── fxmanifest.lua          # Resource manifest

⚙️ Global Settings (config.lua)

return {
    -- Development Settings
    debug = false,        -- Enable debug mode for advanced logging

    -- Core Settings
    maxDistance = 5.0,    -- Maximum interaction distance in meters (anti-exploit)
    waitTime = 100,       -- Default transit time between floors (milliseconds)

    -- Visual & Audio Settings
    useEffects = true,    -- Enable screen fade transitions
    useSounds = true,     -- Enable elevator sound effects globally

    -- Framework Providers
    providers = {
        -- Inventory System (Choose one)
        inventory = 'ox_inventory',    -- Supported: 'ox_inventory', 'qb-inventory'

        -- Core Framework (Choose one)
        core = 'qbx_core',            -- Supported: 'qbx_core', 'qb-core'

        -- Target System (Choose one)
        interaction = 'ox_target',     -- Supported: 'ox_target', 'qb-target'

        -- Notification System (Choose one)
        notify = 'ox_lib',            -- Supported: 'ox_lib', 'qb-core'
    }
}

🏢 Building Configuration

Each building must be defined in data/buildings/ and registered in data/registry.lua.

Example Building (data/buildings/office.lua)

return {
    id = 'downtown_office',           -- Unique identifier
    name = 'Downtown Office',         -- Display name
    description = 'Corporate HQ',     -- Building description

    elevators = {                     -- List of elevators
        {
            id = 'main_elevator',     -- Unique elevator ID
            name = 'Main Elevator',   -- Display name
            description = 'Public',   -- Elevator description
            sound = true,            -- Play sounds (optional)
            waitTime = 200,          -- Override default wait time (optional)

            floors = {               -- List of floors
                -- Example: Public floor
                {
                    id = 'reception',
                    name = 'Reception',
                    description = 'Public Area',
                    teleportCoords = vector4(100.0, 200.0, 35.0, 90.0),
                    target = {
                        coords = vector3(100.0, 200.0, 36.5),
                        size = vector3(0.5, 0.5, 0.5)
                    }
                },
                -- Example: Private floor
                {
                    id = 'lobby',    -- Unique floor ID
                    name = 'Lobby',  -- Display name
                    description = 'Ground Floor', -- Floor description

                    -- Where players teleport to (x, y, z, heading)
                    teleportCoords = vector4(100.0, 200.0, 30.0, 90.0),

                    -- Interaction zone
                    target = {
                        coords = vector3(100.0, 200.0, 31.5),   -- Location
                        size = vector3(0.5, 0.5, 0.5),         -- Zone size
                        rotation = 90.0,                       -- Zone rotation
                        distance = 2.0,                        -- Interaction range
                        icon = 'fas fa-elevator',              -- Custom icon
                        label = 'Call Elevator'                -- Custom label
                    },

                    -- Access Control (all optional)
                    restricted = true,                    -- Hide if no access
                    requiredJobs = {                     -- Required jobs
                        ['police'] = 0,                  -- Job name = min grade
                        ['office'] = 2
                    },
                    requiredItems = {                    -- Required items
                        {
                            name = 'office_guest_keycard',      -- Item name
                            count = 1,                          -- Required amount
                            remove = false                      -- Remove on use
                        }
                    }
                }
            }
        }
    }
}

Building Registry (data/registry.lua)

return {
    ['downtown_office'] = require 'data.buildings.office',
    ['city_hall'] = require 'data.buildings.cityhall',
    -- Add more buildings here
}

Access Control Features

  • Public Access: No restrictions by default

  • Job Restrictions: Require specific jobs/grades

  • Item Requirements: Require items/keycards

  • Hidden Floors: restricted = true hides floors without access

  • Item Removal: remove = true consumes required items

Customization

  • Interaction Range: Adjust maxDistance and target distance

  • Animations: Toggle useEffects and useSounds

  • Wait Times: Global waitTime or per-elevator override

  • Icons/Labels: Customize target appearance

By Sahara Scripters - Elevating your server, one floor at a time

PreviousElevator SystemNextFeatures Overview

Last updated 4 months ago