Configuration

Welcome to the MBT Elevator Configuration Guide!

MBT.Debug = false

This variable controls whether the debug mode is enabled. When set to true, it can help you diagnose issues by providing additional debug information.


MBT.ElevatorSettings = {
    ["Watermark"] = true, 
    ["Speed"] = 1000,
    ["Labels"] = {
        ["Wait"] = "Wait",
        ["PressToOpen"] = "Press the button to open the doors"
    }
  • Watermark: This setting controls whether the Malib Tech watermark is displayed in the application. If set to true, the watermark will be shown.

  • Speed: This determines how fast the elevator changes floors. You can adjust this value from 100 (fast) to 2500 (slow) to control the speed of the elevator.

  • Labels: This section allows you to customize labels used in the elevator. For instance:

    • Wait: The label displayed when passengers are waiting for the elevator.

    • PressToOpen: The label instructing users to press a button to open the elevator doors.


MBT.Labels = {
    -- ...
}

Here, you define various notification messages that will be displayed to users in different situations:

  • wrong_arg: A message indicating that an incorrect argument was used.

  • press_for_use: This message instructs users to press a specific key (usually 'E') to use the elevator.

  • no_players_nearby: This is an error message displayed when no player is nearby the elevator.

  • not_allowed: An error message indicating that the user is not allowed to use the elevator.


MBT.Notification = function (data)
    -- ...
end

MBT.HideUIHelp = function ()
    -- ...
end
  • Notification: A function that generates a notification with specified data, such as title, description, duration, and position.

  • HideUIHelp: A function to hide the UI help text.

MBT.UseTarget = false

This variable determines whether a target script should be used instead of markers to interact with the elevator. It's currently set to false.


MBT.InteractKey    = 'E'  -- Key to press to interact with an elevator
MBT.MarkerDistance = 3.0  -- Distance to interact
MBT.DetectDistance = 7.0  -- Distance to start the detecting of elevator area
MBT.DisplayHint    = true -- Display hint
MBT.HintDistance   = 1.2  -- Distance to display hint
MBT.CustomHint = {
    ["Enabled"] = true,
    ["Looped"] = true,
    ["Show"] = function (label)
        -- ox_lib:showTextUI(label)                             -- Preset for ox_lib
        MBT.CustomFunctions["loop_notif"](label)
    end,
    ["Hide"] = function ()
        -- ox_lib:hideTextUI()                                  -- Preset for ox_lib
    end
}

InteractKey: The key (e.g., 'E') that the user needs to press to interact with the elevator.

MarkerDistance: The distance within which a user needs to be to interact with the elevator using markers.

DetectDistance: The distance at which the elevator's area detection starts.

DisplayHint: Determines whether to display a hint to the user.

HintDistance: The distance at which the hint is displayed.


MBT.CustomHint = {
    -- ...
}

This section allows you to define custom hints to display to the user:

  • Enabled: Set to true to enable custom hints.

  • Looped: Set to true to loop the custom hint.

  • Show: A function that displays the custom hint.

  • Hide: A function that hides the custom hint.


function MBT.UIHelp(data) 
    --
end

This function displays UI help text to the player, providing information and instructions.


MBT.CustomImports = {
    ox_lib = exports["ox_lib"]
}

Here, you can import external scripts or libraries. In this case for example, the ox_lib library is being imported from exports["ox_lib"].


MBT.CustomFunctions = {
    -- ...
}

This section allows you to define custom functions that enhance the functionality of the elevator system. One function is defined here:

  • loop_notif: A function that displays a looping notification message to the user.


MBT.Hacking = {
    ["Active"] = true,
    ["TimeLimit"] = 300,
    ["ResetTime"] = 66,
    ["Item"] = "notebook",
    ["DeclareItem"] = function ()                               -- Declare item to use(Preset for ox_inventory) 
        exports("hackElevator", function(data, slot)
            exports.ox_inventory:useItem(data, function(data) 
                TriggerEvent("mbt_elevator:startHacking")
            end)
        end)
    end
}

This table contains settings related to hacking the elevator system:

  • Active: A boolean value to enable or disable elevator hacking.

  • TimeLimiti: The time limit for hacking.

  • ResetTime: The time interval for resetting the hacking state.

  • Item: The name of item required for hacking.

  • DeclareItem: A function to declare the hacking item.


MBT.Elevators = {
    -- ...
}

This section defines specific elevators and their configurations. Each elevator has various settings:

  • Coords: The coordinates of the elevator's location.

  • Type: The type of elevator(Wood, Metal, Gold).

  • Hackable: A boolean value to enable or disable if an elevator can be hacked.

  • Job: The jobs can be use the elevator.

  • Timed: The hours when it is possible to use the elevator.

  • Floors: Defines the floors the elevator serves, along with their respective coordinates.

  • Timed: Specifies a time range during which certain elevator features are active.

  • Target: Details related to using a target script for the elevator.

  • Marker: Information for the marker associated with the elevator.


Last updated