Studios
Casino Heisthouse-3.jpg

Examples

SoonCasino HeistQbox
PAGE 04 OF 06  ·  CONFIGURATION → EXAMPLES → TROUBLESHOOTINGdocs.glitchstudios.dev
Browse docs

Run it without the criminal tablet#

-- config.lua
Config.Job.requireContract = 'no'

Anyone can start the heist, as long as Config.Job.minPolice police are online.

Make a quick test setup#

Config.Job.minPolice       = 0
Config.Job.requireContract = 'no'
Config.Job.cooldown        = 60
Config.Debug               = true

With Config.Debug on, the server console prints a line when a run starts and when it ends. Set the values back before going live.

Turn off the XP perks#

Config.Perks = {
    dualWindow    = nil,
    saveExplosive = nil,
}

Use ox_doorlock door names#

Config.Doors = {
    vault = 'casino_vault',
    -- the other 34 entries
}

Add a matching entry to install/doors.json:

{
  "casino_vault": {
    "coords": { "x": 2504.0, "y": -238.4, "z": -70.7 },
    "model": 2121050683,
    "heading": 0,
    "state": 1,
    "maxDistance": 2.0
  }
}

The coordinates and model above are placeholders. Use your own values. If ox_doorlock has no door named casino_vault, server/doors.lua creates it at start-up and prints created 1 ox_doorlock door(s).

Listen for a run starting and ending#

The definition fires two server events through the engine. Another resource can handle them, for example to log runs.

AddEventHandler('glitch-casinoHeist:runStarted', function(e)
    local src = e and e.src
    print(('Casino heist started by %s'):format(src and GetPlayerName(src) or 'unknown'))
end)

AddEventHandler('glitch-casinoHeist:runEnded', function()
    print('The casino heist is over')
end)

runEnded fires on a successful escape and on a failed run.

Night vision from your own code#

-- client script in any resource
RegisterCommand('nv', function()
    exports['glitch-casinoHeist']:ToggleNightvision()
end)

Calling the export again turns night vision off. It plays the mask animation each time.