Skip to content

Configuration

All configuration is done in config.lua, located in the root of the sd-oilrig resource folder.

Locale

Change the language by editing line 3 of config.lua:

lua
SD.Locale.LoadLocale('en') -- Options: 'en', 'de', 'es', 'fr', 'ar'

MLO Type

The oil rig supports two MLO variants. Set this to match the MLO you have installed on your server:

lua
Config.MLOType = 'k4mb1' -- 'k4mb1' or 'nopixel'
ValueMLO
'k4mb1'K4MB1's Oil Rig MLO
'nopixel'NoPixel's Oil Rig MLO

WARNING

All coordinates (locations, guards, barrels, blip) are pre-configured for both MLOs. Changing Config.MLOType switches the entire coordinate set automatically — no manual coordinate changes needed.

General Settings

KeyTypeDefaultDescription
Config.OilRigDebugbooleanfalseEnable PolyZone debug visualization for testing
Config.HasSpawnedInOilrigbooleantrueInternal spawn flag. Set to false for testing only — must be true on live servers
Config.MinimumCopsnumber3Minimum on-duty police required to start the heist
Config.PoliceJobstable{'police'}Array of job names counted toward the police requirement
Config.Interactionstring'target'Interaction mode: 'target' (qb-target/ox_target) or 'textui' (drawtext/ox_lib textui)
Config.Cooldownnumber180Cooldown between heists in minutes
Config.ResetOilOnLeavebooleanfalseIf true, resets the rig and cooldown when all players leave before the USB dongle has been used
Config.CheckForItembooleanfalseIf true, requires the security_card_oil item when entering the zone to trigger the heist
Config.AlertPoliceOnEnterbooleanfalseIf true, alerts police when someone enters the zone. If false, alerts when the USB dongle is inserted
Config.GiveHintsbooleanfalseShow hint messages guiding players through the heist stages

WARNING

If you restart the script with Config.HasSpawnedInOilrig = true, the resource will not function correctly. Only set it to false for testing, and always change it back to true for your live server.

Police Alert

The police dispatch is configured via a function in the config. You can modify the alert details or replace the function entirely to integrate with your dispatch system.

lua
policeAlert = function()
    SD.PoliceDispatch({
        displayCode = "10-31H",
        title = 'Oilrig Heist',
        description = "Oilrig Heist in progress",
        message = "Suspects reported on the oilrig",
        sprite = 310,
        scale = 1.0,
        colour = 1,
        blipText = "Oilrig Heist",
        dispatchcodename = "oilrig_heist"
    })
end
KeyTypeDefaultDescription
displayCodestring"10-31H"Dispatch code shown in alerts
titlestring'Oilrig Heist'Title used in cd_dispatch/ps-dispatch
descriptionstring"Oilrig Heist in progress"Description of the alert
messagestring"Suspects reported on the oilrig"Additional message or information
spritenumber310Blip sprite for the dispatch marker
scalenumber1.0Dispatch blip size on the map
colournumber1Dispatch blip color
blipTextstring"Oilrig Heist"Text on the dispatch blip
dispatchcodenamestring"oilrig_heist"Code name used by ps-dispatch in sv_dispatchcodes.lua

Items Used

These are the items required throughout the heist:

lua
Config.Items = {
    Laptop = 'laptop_pink',
    USB = 'security_card_oil',
    Barrel = 'oilbarrel',
    ReviveKit = 'revivekit'
}
KeyTypeDefaultDescription
Laptopstring'laptop_pink'Item required to hack laptop terminals
USBstring'security_card_oil'Item used to insert the dongle and start the heist
Barrelstring'oilbarrel'Item representing a collected oil barrel
ReviveKitstring'revivekit'Item used to revive downed teammates

Final Items

Items awarded to the player upon completing the heist (entering the correct password):

lua
Config.FinalItems = {'security_card_01', 'security_card_02', 'token'}

You can add or replace any items in this array. Ensure all items exist in your inventory database.

Laptop Behavior

KeyTypeDefaultDescription
Config.RemoveLaptopOnUsebooleanfalseIf true, removes a laptop item each time a hack is started
Config.RemoveLaptopOnSuccessbooleantrueIf true, removes a laptop item each time a hack is successfully completed
Config.ViewLettersbooleantrueAllow players to re-view revealed letters after hacking. If false, letters can only be viewed once
Config.UseChatMessagesbooleanfalseIf true, sends revealed letters via chat. If false, sends them as notifications

Laptop Props

Laptop props can be spawned at each hack location:

lua
Config.SpawnLaptops = {
    Enable = true,
    Prop = 'h4_prop_h4_laptop_01a',
    locations = { ... }
}
KeyTypeDefaultDescription
EnablebooleantrueSpawn laptop props at hack locations
Propstring'h4_prop_h4_laptop_01a'Prop model for the laptop

Password System

A random 4-letter word is selected at the start of each robbery. Players discover the letters by hacking the 4 laptops.

lua
Config.Password = {
    { word = "DART", letters = { "D", "A", "R", "T" } },
    { word = "EURO", letters = { "E", "U", "R", "O" } },
    -- Add more words as needed (must be 4 letters, all uppercase)
}
KeyTypeDefaultDescription
Config.PasswordAttemptsnumber2Number of password attempts allowed before the heist fails
Config.SimplifiedMessagesbooleanfalseIf true, tells players the position of the letter (e.g. "it's the first letter"). If false, only states the letter itself

TIP

You can add as many words as you like. Each must be exactly 4 letters and all uppercase.

Lever Sequence

By default, the lever sequence is randomized each robbery. To force a specific sequence, uncomment and set:

lua
-- Config.LeverSequence = {3, 1, 2} -- Pull Lever 3, then Lever 1, then Lever 2

INFO

If Config.LeverSequence is not defined (commented out), the script automatically generates a random 3-lever sequence each robbery.

Pressure Management

After the levers are pulled, the automatic pressure regulators are deactivated. Players must manually regulate pressure using valves.

KeyTypeDefaultDescription
Config.PressureToExplodenumber80Pressure threshold — if pressure exceeds this value, the oil rig explodes

WARNING

Pressure must be regulated to approximately 55%. If pressure rises above Config.PressureToExplode (default: 80), the rig will explode. If it drops too low, the rig seizes up and the heist fails.

Animation & Behavior Settings

KeyTypeDefaultDescription
Config.ChangeTimebooleanfalseIf true, changes the weather and time of day when entering/leaving the oil rig zone (QBCore / qb-weathersync only)
Config.FadeOutInbooleantrueFade the screen in/out when entering or leaving the oil rig zone
Config.ForceAnimationbooleanfalseForce players into a barrel-carry animation when holding the oilbarrel item
Config.SendToBeachOnSpawnbooleantrueSend players to the beach if they spawn/log in on the oil rig, to prevent exploit re-entry
Config.WashUpOnBeachbooleantrueTeleport players to the beach after completing the heist
Config.RemoveGuardsOnEndbooleantrueRemove guards when the heist ends (prevents opportunistic looting after the heist)
Config.SendBackOnResetbooleantrueSend players to the beach if they are in the oil rig area when the cooldown resets
Config.UsingReviveKitsbooleantrueEnable revive kit functionality. If false, revive kits have no effect

Blip

lua
Config.Blip = {
    Enable = true,
    Sprite = 378,
    Display = 4,
    Scale = 0.6,
    Colour = 1,
    Name = "Secured Oil Rig",
    Locations = {
        k4mb1   = vector3(-2729.26, 6598.01, 44.0),
        nopixel = vector3(-3560.24, 7378.44, 43.91),
    }
}
KeyTypeDefaultDescription
EnablebooleantrueShow the oil rig blip on the map
Spritenumber378Blip icon sprite ID
Displaynumber4Blip display mode
Scalenumber0.6Blip size on the map
Colournumber1Blip color ID
Namestring"Secured Oil Rig"Text label for the blip
Locations.k4mb1vector3(-2729.26, 6598.01, 44.0)Blip position for K4MB1 MLO
Locations.nopixelvector3(-3560.24, 7378.44, 43.91)Blip position for NoPixel MLO

Hacking Minigame

lua
Config.Hacking = {
    Laptop = {
        Minigame = 'hacking-opengame',
        Args = { ... }
    }
}

Set the Minigame value to the name of the minigame you want to use. The Args table contains pre-configured arguments for every supported minigame — only the one matching your Minigame selection is used.

Supported Minigames

SourceMinigame KeyDefault ArgsDescription
ps_uips-circle{2, 20}Number of circles, time (ms)
ps_uips-maze{20}Time (seconds)
ps_uips-varhack{2, 3}Number of blocks, time (seconds)
ps_uips-thermite{10, 5, 3}Time (s), grid size, incorrect blocks
ps_uips-scrambler{'numeric', 30, 0}Type, time (s), mirrored option
memorygamememorygame-thermite{10, 3, 3, 10}Correct blocks, incorrect blocks, show time (s), lose time (s)
ranran-memorycard{360}Time (seconds)
ranran-openterminal{}No arguments
nopixelhacking-opengame{15, 4, 1}Time (s), number of blocks, number of repeats
howdyhowdy-begin{3, 5000}Number of icons, time (ms)
snsn-memorygame{3, 2, 10000}Keys needed, rounds, time (ms)
snsn-skillcheck{50, 5000, {'w','a','s','w'}, 2, 20, 3}Speed (ms), time (ms), keys, rounds, bars, safe bars
snsn-thermite{7, 5, 10000, 2, 2, 3000}Boxes, correct boxes, time (ms), lives, rounds, show time (ms)
snsn-keypad{999, 3000}Code number, time (ms)
snsn-colorpicker{3, 7000, 3000}Icons, type time (ms), view time (ms)
rainmadrm-typinggame{'easy', 20}Difficulty, duration (s)
rainmadrm-timedlockpick{200}Speed value
rainmadrm-timedaction{3}Number of locks
rainmadrm-quicktimeevent{'easy'}Difficulty
rainmadrm-combinationlock{'easy'}Difficulty
rainmadrm-buttonmashing{5, 10}Decay rate, increment rate
rainmadrm-angledlockpick{'easy'}Difficulty
rainmadrm-fingerprint{200, 5}Time (s), lives
rainmadrm-hotwirehack{10}Time (seconds)
rainmadrm-hackerminigame{5, 3}Length, lives
rainmadrm-safecrack{'easy'}Difficulty

Guards

KeyTypeDefaultDescription
Config.EnableGuardsbooleantrueEnable NPC guard spawning on the oil rig
Config.EnableLootingbooleantrueAllow players to loot dead guards

Guard Parameters

lua
Config.PedParameters = {
    Ped = "s_m_y_marine_01",
    Health = 200,
    Weapon = {"WEAPON_PISTOL", "WEAPON_SMG", "WEAPON_ASSAULTRIFLE"},
    MinArmor = 50,
    MaxArmor = 100,
    Headshots = true,
    CombatAbility = 100,
    Accuracy = 60,
    CombatRange = 2,
    CombatMovement = 2,
    CanRagdoll = true,
}
KeyTypeDefaultDescription
Pedstring"s_m_y_marine_01"Ped model for the guards
Healthnumber200Maximum and initial health of guards
Weapontable{"WEAPON_PISTOL", "WEAPON_SMG", "WEAPON_ASSAULTRIFLE"}List of weapons randomly assigned to guards
MinArmornumber50Minimum armor value for guards
MaxArmornumber100Maximum armor value for guards
HeadshotsbooleantrueWhether guards can receive critical hits (headshots)
CombatAbilitynumber100Combat ability (0-100, higher = better)
Accuracynumber60Shot accuracy (0-100, higher = more accurate)
CombatRangenumber2Engagement range: 0 = short, 1 = medium, 2 = long
CombatMovementnumber2Movement style: 0 = calm, 1 = normal, 2 = aggressive
CanRagdollbooleantrueWhether guards can be ragdolled from player impact

Guard Spawn Locations

Guards are defined in Config.Guards with separate coordinate sets for each MLO. Each entry is a vector4 with x, y, z, and heading. K4MB1 includes 25 spawn points; NoPixel includes 23. You can add, remove, or reposition guards by editing the coords table for your MLO.

Guard Loot Rewards

lua
Config.Rewards = {
    weaponChance = 60,
    itemRange = { min = 2, max = 3 },
    PistolRewards  = { items = {"weapon_heavypistol", "weapon_pistol", "weapon_pistol_mk2"}, chance = 37, isGunReward = true },
    RareRewards    = { items = {"weapon_assaultrifle", "weapon_compactrifle", "weapon_mg"}, chance = 15, isGunReward = true },
    SMGRewards     = { items = {"weapon_assaultsmg", "weapon_minismg", "weapon_combatpdw"}, chance = 32, isGunReward = true },
    ShotgunRewards = { items = {"weapon_sawnoffshotgun", "weapon_pumpshotgun", "weapon_dbshotgun"}, chance = 25, isGunReward = true },
    AmmoRewards    = { items = {"pistol_ammo", "shotgun_ammo", "rifle_ammo", "smg_ammo"}, chance = 45, amount = {min = 1, max = 2} },
    MedicRewards   = { items = {"bandage", "revivekit"}, chance = 45, amount = {min = 1, max = 2} },
}
KeyTypeDefaultDescription
weaponChancenumber60Overall percentage chance of receiving any gun-related reward
itemRangetable{min = 2, max = 3}Min/max number of items a player receives per loot
PistolRewards.chancenumber37Weighted chance for pistol category
RareRewards.chancenumber15Weighted chance for rare weapon category
SMGRewards.chancenumber32Weighted chance for SMG category
ShotgunRewards.chancenumber25Weighted chance for shotgun category
AmmoRewards.chancenumber45Weighted chance for ammo category
AmmoRewards.amounttable{min = 1, max = 2}Random quantity of ammo items given
MedicRewards.chancenumber45Weighted chance for medical supply category
MedicRewards.amounttable{min = 1, max = 2}Random quantity of medical items given

INFO

The chance values are relative weights, not percentages that must add to 100. A category with chance = 45 is three times more likely than one with chance = 15. Only one gun reward (isGunReward = true) can be selected per loot. Non-gun categories can stack freely within itemRange.

Gas Stations

Nine gas station locations are defined in Config.GasStation. Each has a world position and a randomized price generated at resource start.

lua
Config.GasStation = {
    [1] = { coords = vector4(-702.93, -916.52, 19.44, 353.14), price = math.random(10000, 12299) },
    [2] = { coords = vector4(-41.16, -1748.3, 29.83, 133.28),  price = math.random(9000, 12299) },
    -- ... (9 stations total)
}

You can add, remove, or reposition stations by editing the Config.GasStation table. Prices are randomized between the given min and max when the resource starts.

Locations

All interactable positions are defined per-MLO in Config.Locations. The correct set is selected automatically based on Config.MLOType.

lua
Config.Locations = {
    k4mb1 = {
        BeachWashup      = vector4(-963.05, 5583.61, 2.83, 49.92),
        Levers           = vector3(-2733.54, 6607.53, 21.5),
        PuzzleStart      = vector3(-2723.67, 6600.28, 15.1),
        PressureValve    = vector3(-2714.35, 6607.18, 21.48),
        CheckPressure    = vector3(-2721.89, 6598.96, 22.98),
        AttemptPassword  = vector3(-2732.49, 6621.32, 25.29),
        HackLocation_1   = vector3(-2739.00, 6610.12, 21.74),
        HackLocation_2   = vector3(-2739.83, 6608.22, 15.04),
        HackLocation_3   = vector3(-2722.96, 6591.19, 14.90),
        HackLocation_4   = vector3(-2745.14, 6602.63, 29.45),
    },
    nopixel = { ... } -- Same keys, NoPixel-specific coordinates
}

Oil Rig Detection Zone

The area detection zone is defined as a sphere:

lua
Config.Points = {
    oilrig = {
        k4mb1   = { coords = vector3(-2825.73, 6596.33, 0.0), distance = 500.0 },
        nopixel = { coords = vector3(-3538.09, 7312.83, 0.0), distance = 500.0 },
    }
}
KeyTypeDefaultDescription
coordsvector3(per MLO)Approximate center of the oil rig area
distancenumber500.0Detection radius around the center point

Puzzle Configuration

The puzzle state table tracks heist progression. These are internal default values and reset each robbery.

lua
Config.Puzzle = {
    [1] = { levers = false },           -- Whether levers have been pulled
    [2] = { one = false },              -- Laptop 1 hacked
    [3] = { two = false },              -- Laptop 2 hacked
    [4] = { three = false },            -- Laptop 3 hacked
    [5] = { four = false },             -- Laptop 4 hacked
    [6] = { pressure = math.random(20, 80) }, -- Starting pressure (randomized)
    [7] = { bricked = false },          -- Whether the system has been bricked (failed)
}

WARNING

Do not modify Config.Puzzle unless you fully understand the heist flow. Incorrect changes can break the progression system.