La FactorY
Script documentation

YF-Fleeca: documentation

YF-Fleeca is a complete crew heist: buy a plan, take out the cameras, open the vault with the real GTA mini-games, empty the table and lose the police. Everything is handled by the server and shared between players.

v1.0.0ESX · QBCore · Qboxno framework neededox_inventoryox_target

YF-Fleeca – 42 €

Overview

  • All 6 Fleeca branches on the map, no MLO to install.
  • 5 approaches: intimidation, hacking, safecracking, explosives, thermal drill.
  • In-game mini-games (Hacking_PC hacking, vault dial, drill), no progress bars.
  • Teller, panicking hostages, cameras to destroy, animated vault door.
  • Random bonus: a deposit box to drill, a USB drive to deliver to a contact.
  • ESX, QBCore, Qbox or no framework, detected automatically.
  • Police dispatch can plug into your script, built-in alert otherwise.
  • French and English included, English subtitles for the voice lines.

Presentation video, from the heist plan to delivering the USB drive: watch YF-Fleeca on YouTube.

Requirements

ResourceRole
ox_libNotifications, menus, client-server calls.
ox_inventoryPlans, tools, USB drive, and cash in no-framework mode.
ox_targetPlan vendor, cash table, hostages, contact.
Framework (optional)es_extended, qb-core or qbx_core: cash and police job. Without a framework, see Police and dispatch.

No database is needed: nothing is stored in SQL.

Game build 2189 minimum

The cash pile and the pickup animation come from the Cayo Perico Heist DLC. Set sv_enforceGameBuild 2189 or higher in your server.cfg.

OneSync must be enabled: the server checks the players' position at every step.

Installation

Six steps, in this order.

  1. Add the resource

    Get YF-Fleeca from the Cfx.re portal (see Getting your purchases). Copy the YF-Fleeca folder into your resources, without renaming it: the protected version is tied to that name. Add it to your server.cfg, after its dependencies and your framework.

    server.cfg
    ensure ox_lib
    ensure ox_inventory
    ensure ox_target
    # ensure es_extended / qb-core / qbx_core
    ensure YF-Fleeca
  2. Declare the items

    Add the block from the Items section at the end of ox_inventory/data/items.lua, before the last closing brace.

  3. Copy the images

    Copy the 11 yf_*.png images from the install/images folder into ox_inventory/web/images.

  4. Grant the permissions

    Staff commands use an ACE permission. In no-framework mode, so does the police.

    server.cfg
    add_ace group.admin yf-fleeca.admin allow
    # no framework only:
    add_ace group.police yf-fleeca.police allow
  5. Adjust the config

    Open shared/config.lua: language, police jobs, required number of officers, plan vendor, contact locations. Plug your dispatch into server/dispatch_custom.lua. Details in Configuration.

  6. Restart the server

    A full restart is needed the first time, to load the new items. The console shows the detected framework: [yf-fleeca] framework : esx.

Items

11 items: the five heist plans, the tools handed out at launch, and the bonus USB drive. The block below uses English labels; the French labels are in the French documentation.

ox_inventory/data/items.lua
-- YF-Fleeca

['yf_plan_teller'] = {
    label = "Heist Plan [Intimidation]",
    weight = 50,
    stack = true,
    close = true,
    description = "Plan for a Fleeca robbery by intimidating the teller. Used up at launch.",
},

['yf_plan_laptop'] = {
    label = "Heist Plan [Hacking]",
    weight = 50,
    stack = true,
    close = true,
    description = "Plan for a Fleeca robbery by hacking the vault. Exchanged at launch for the hacking laptop.",
},

['yf_plan_safecrack'] = {
    label = "Heist Plan [Safecracking]",
    weight = 50,
    stack = true,
    close = true,
    description = "Plan for a Fleeca robbery by cracking the vault. Exchanged at launch for the safecracking kit.",
},

['yf_plan_bomb'] = {
    label = "Heist Plan [Explosives]",
    weight = 50,
    stack = true,
    close = true,
    description = "Plan for a Fleeca robbery with explosives. Exchanged at launch for the charges.",
},

['yf_plan_thermaldrill'] = {
    label = "Heist Plan [Thermal Drill]",
    weight = 50,
    stack = true,
    close = true,
    description = "Plan for a Fleeca robbery with a thermal drill. Exchanged at launch for the drill.",
},

['yf_fleeca_laptop'] = {
    label = "Hacking Laptop",
    weight = 2500,
    stack = false,
    close = true,
    description = "Used to hack the vault door of a Fleeca.",
},

['yf_fleeca_crackkit'] = {
    label = "Safecracking Kit",
    weight = 1000,
    stack = false,
    close = true,
    description = "Used to crack the vault door of a Fleeca.",
},

['yf_fleeca_charge'] = {
    label = "Explosive Charge",
    weight = 1000,
    stack = true,
    close = true,
    description = "Placed on the vault door of a Fleeca.",
},

['yf_fleeca_drill'] = {
    label = "Thermal Drill",
    weight = 6000,
    stack = false,
    close = true,
    description = "Mounted on the vault door of a Fleeca.",
},

['yf_fleeca_boxdrill'] = {
    label = "Deposit Box Drill",
    weight = 3000,
    stack = false,
    close = true,
    description = "Drills the deposit boxes in the wall of a Fleeca vault.",
},

['yf_fleeca_usb'] = {
    label = "Compromising USB Drive",
    weight = 50,
    stack = true,
    close = true,
    description = "USB drive taken from a Fleeca deposit box. A contact pays well to get it back.",
},
ItemRoleWeight
Heist Plan [Intimidation]
yf_plan_teller
Plan: intimidation50 g
Heist Plan [Hacking]
yf_plan_laptop
Plan: hacking50 g
Heist Plan [Safecracking]
yf_plan_safecrack
Plan: safecracking50 g
Heist Plan [Explosives]
yf_plan_bomb
Plan: explosives50 g
Heist Plan [Thermal Drill]
yf_plan_thermaldrill
Plan: thermal drill50 g
Hacking Laptop
yf_fleeca_laptop
Tool: hacking2,500 g
Safecracking Kit
yf_fleeca_crackkit
Tool: safecracking1,000 g
Explosive Charge
yf_fleeca_charge
Tool: explosives (×2)1,000 g
Thermal Drill
yf_fleeca_drill
Tool: thermal drill6,000 g
Deposit Box Drill
yf_fleeca_boxdrill
Bonus: drilling the box3,000 g
Compromising USB Drive
yf_fleeca_usb
Bonus: deliver to the contact50 g

How a heist plays out

Default config values.

$3,200the planbought from the vendorrandom approach
[E]the launchat the doorcrew within 15 m
5camerasto destroymarked on the map
1vaultopened by the approachof the plan
$8–12kthe tableone pilepicked up by the leader
150 mthe getawaythe whole crewaway from the branch

The alarm goes off 30 s after the launch. A robbed branch resets after 60 min; only one Fleeca heist at a time in the city.

The leader

Whoever launches the heist is its leader: they use up their plan, receive the tools, pick up the cash from the table and drill the bonus box. The whole crew sees the objectives. If the leader disconnects, another member takes over.

Failure

The heist fails if no crew member is able to act within 35 m of the entrance for 15 s, before the table is emptied. It is also closed automatically after 30 min. A discreet card at the top of the screen announces success or failure, without getting in the way of driving.

The approaches

The heist plan decides how the vault is opened. If the leader carries several plans, they choose at launch.

yf_plan_teller

Intimidation

  • No tool: you have to hold up the teller.
  • Aiming and shooting raise the intimidation gauge.
  • The more scared he is, the faster he opens the vault. Follow him while keeping him at gunpoint.
yf_plan_laptop · yf_fleeca_laptop

Hacking

  • Laptop placed on the door's control box.
  • The game's Hacking_PC mini-game: open the right program, then the connection and the password.
  • A failed attempt sends you back to the desktop.
yf_plan_safecrack · yf_fleeca_crackkit

Safecracking

  • Dial placed on the vault door.
  • Turn right then left, notch by notch, listening for the click.
  • E to give up.
yf_plan_bomb · yf_fleeca_charge ×2

Explosives

  • Two charges to place on the door, left click.
  • Take cover in the hall, then E to detonate.
  • The beeps speed up for 6 s, then the door blows. The crew takes no damage.
yf_plan_thermaldrill · yf_fleeca_drill

Thermal drill

  • The drill is mounted on the door and bores for 60 s.
  • Meanwhile, keep the hostages at gunpoint: if the intimidation gauge drops, a hostage triggers the alarm.
  • Remove the drill at the end (E) to open the vault.
Hostages

Three customers are inside each branch. The crew can release them with ox_target: they walk out with their hands up then run away, something to negotiate with the police.

Bonus and contact

One time in four, a tip-off points to a sensitive deposit box in the vault wall. The leader receives a deposit box drill at launch.

  • Drilling the box: hold left click for the motor, mouse up to push.
  • The box contains a compromising USB drive, marked with the leader's name: only they can deliver it.
  • A contact appears at a location drawn at random from the config. The crew gets the GPS route as soon as the box is drilled.
  • The contact pays $5,000 per drive, in cash, with a short handover cutscene.

The contact only exists during a heist with a bonus, or as long as a drive has not been delivered. They stay at the same spot until then, and the next draw avoids that location.

Configuration

shared/config.lua is the only settings file to edit, commented in French and English. An invalid value is reported in the console at startup and replaced by its default.

SettingDefaultEffect
Config.locale'fr'Language of the texts shown: 'fr' or 'en'. See Languages.
Config.framework'auto''auto' detects qbx_core, then qb-core, then es_extended, otherwise runs without a framework. To force one: 'esx', 'qb', 'qbx', 'standalone'.
Config.money.item'money'No framework only: the ox_inventory item used as cash. With a framework, the framework's cash is used.
Config.admin.ace'yf-fleeca.admin'ACE permission that grants access to the staff commands.
Config.police.jobs{ 'police', 'sheriff' }Technical names of the jobs counted as police, with ESX, QBCore or Qbox. They receive the built-in alert and count towards the minimum number of officers.
Config.police.ace'yf-fleeca.police'No framework only: a player with this ACE permission counts as an on-duty officer.
Config.police.minOnDuty4On-duty officers required to launch a heist. Set 0 to test alone.
Config.loot8000 – 12000min and max of the cash on the table. The amount is drawn by the server and never sent to the client before the pickup.
Config.planVendorThe NPC selling the plans, at a single position: coords as vec4(x, y, z, heading), and price, the price of a plan in cash ($3,200). His seat follows his position automatically. No blip: the address is passed on between players.
Config.bonus.chance25Percentage of heists with the bonus box, from 0 (never) to 100 (always).
Config.contactlocations: possible locations of the contact who buys the USB drive, as vec4(x, y, z, heading); 12 provided, add or remove as you like. reward: payment per delivered drive, drawn between min and max ($5,000).
Getting a position

Stand at the spot you want, facing the desired direction, then read your coordinates and heading with your admin menu (or GetEntityCoords(PlayerPedId()) and GetEntityHeading(PlayerPedId())). The expected z height is that of a standing player.

Shipped file

The complete file with its default values. Copy it back to return to the original configuration.

shared/config.lua
Config = {}

Config.locale = 'fr'

Config.framework = 'auto'

Config.money = { item = 'money' }

Config.admin = { ace = 'yf-fleeca.admin' }

Config.police = {
    jobs = { 'police', 'sheriff' },

    ace = 'yf-fleeca.police',

    minOnDuty = 4,
}

Config.planVendor = {
    coords = vec4(-358.2050, 16.1889, 46.3549, 258.7397),

    price = 3200,
}

Config.loot = {
    min = 8000,
    max = 12000,
}

Config.bonus = {
    chance = 25,
}

Config.contact = {
    locations = {
        vec4(1085.0905, -2287.8787, 30.2286, 262.7219),
        vec4(143.0727, -3075.3372, 5.8963, 180.3207),
        vec4(-564.8896, -2322.7942, 13.9146, 318.2265),
        vec4(176.4104, -686.3036, 33.1230, 158.1722),
        vec4(-372.4448, -92.6789, 45.6637, 254.9622),
        vec4(-1024.3159, 828.6182, 172.3921, 4.4594),
        vec4(2340.9258, 3140.4905, 48.2087, 261.8160),
        vec4(1536.9336, 3589.5247, 38.7665, 123.9719),
        vec4(-510.1786, 4366.8784, 67.6254, 170.0338),
        vec4(1979.6206, 5176.8965, 47.6391, 219.5273),
        vec4(1711.2861, 6432.3477, 32.7621, 332.8784),
        vec4(2.6436, 6279.2295, 31.3743, 217.8062),
    },

    reward = { min = 5000, max = 5000 },
}

Police and dispatch

Who counts as police depends on the framework:

FrameworkOn-duty officer
ESXJob listed in Config.police.jobs, and on duty if your ESX handles duty.
QBCore · QboxJob listed in Config.police.jobs with onduty.
No frameworkPlayer with the ACE permission yf-fleeca.police.

Plugging in your dispatch

server/dispatch_custom.lua is not encrypted. The CustomDispatch(alert) function is called at every alarm: send the alert with your script and return true. If it returns false, or if your code crashes, the built-in alert takes over: a notification and a flashing blip for on-duty officers.

The function runs server-side, 30 s after the heist is launched. Use your dispatch script's server export.

alert fieldTypeContent
titlestringTranslated title, "Fleeca robbery".
messagestringTranslated text with the name of the branch.
bankstringName of the branch, for example 'Legion Square'.
coordsvector3Position of the branch.
codestringRadio code, '10-90'.
durationnumberRecommended lifetime of the alert, in seconds (600).
bliptable{ sprite = 118, color = 1, scale = 1.2 }: red bank robbery blip.
jobstablePolice jobs from Config.police.jobs.
policetableServer ids of the officers on duty at that moment.

Shipped file

It contains a ready-to-use example for lb-tablet, only used if lb-tablet is started. Add your dispatch the same way, before the final return false.

server/dispatch_custom.lua
function CustomDispatch(alert)
    if GetResourceState('lb-tablet') == 'started' then
        for _, job in ipairs(alert.jobs) do
            exports['lb-tablet']:AddDispatch({
                priority = 'high',
                code = alert.code,
                title = alert.title,
                description = alert.message,
                location = { label = alert.bank, coords = vec2(alert.coords.x, alert.coords.y) },
                time = alert.duration,
                job = job,
                blip = {
                    sprite = alert.blip.sprite,
                    size = alert.blip.scale,
                    color = alert.blip.color,
                    shortRange = true,
                    label = alert.title,
                    flashes = true,
                },
            })
        end
        return true
    end

    return false
end

Template for another script, to adapt to its export:

server/dispatch_custom.lua
if GetResourceState('my-dispatch') == 'started' then
    exports['my-dispatch']:SendAlert({
        title = alert.title,
        message = alert.message,
        coords = alert.coords,
        jobs = alert.jobs,
    })
    return true
end

Staff commands

Available in the server console and in game for players with the yf-fleeca.admin permission.

CommandEffect
fleecastatusOn-duty officers, and the state of each branch: free, in progress (duration, crew size) or resetting.
fleecaresetCancels the heists in progress and resets every branch.
fleecareset <n>A single branch: 1 Great Ocean Highway, 2 Boulevard Del Perro, 3 Hawick Avenue, 4 Alta Street, 5 Route 68, 6 Legion Square.

Languages

Every text shown to players is in locales/, readable and editable. To add a language:

  • copy locales/en.lua to locales/de.lua;
  • replace Locales['en'] with Locales['de'] and translate the sentences;
  • keep the %s and %d in the same order;
  • set Config.locale = 'de'.

The plan vendor speaks French: in other languages, his lines are shown as subtitles. Item names are translated in items.lua.

Troubleshooting

"Not enough police on duty"

Check Config.police.jobs (exact job names) and minOnDuty. Without a framework, officers need the yf-fleeca.police permission. fleecastatus shows the number counted. To test alone, set minOnDuty = 0.

A yellow "config.lua: …" message at startup

A value in shared/config.lua is invalid: the message names it and shows the value used instead. Common causes: a price written in quotes, a position that is not a vec4, a missing comma between two locations. If no contact location is valid anymore, the bonus is disabled.

The wrong framework is detected

The console shows [yf-fleeca] framework : … at startup. Start YF-Fleeca after your framework, or force it with Config.framework.

"Access denied" on staff commands

The ACE permission is missing. Add add_ace group.admin yf-fleeca.admin allow (adapt the group to your server) then restart. Check with test_ace player.<id> yf-fleeca.admin in the console.

The cash pile or the pickup animation is missing

The game build is too old. Set sv_enforceGameBuild 2189 or higher.

Items have no image in the inventory

Check that the 11 yf_*.png files are in ox_inventory/web/images, then clear the FiveM cache: ox_inventory often keeps the old images.

No alert in my police tablet

Plug your dispatch into server/dispatch_custom.lua. If your code errors, the console shows erreur dans CustomDispatch and the built-in alert is sent instead.

The contact is nowhere to be found

That is normal outside the bonus: they only appear during a heist with a deposit box, or as long as a USB drive has not been delivered. Their NPC is only created within 60 m; follow the GPS route given when the box is drilled.

"You lack the required entitlement"

The resource is not linked to the Cfx.re account of your server key, or the folder was renamed. Download it from the Cfx.re portal with the account that bought it (see Getting your purchases) and keep the name YF-Fleeca.

Other guides

All documentation

  1. Join the La FactorY Discord.
  2. Open a ticket naming the product.
  3. The team gets back to you quickly to complete the purchase.
Open Discord