> For the complete documentation index, see [llms.txt](https://docs.scrumbee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scrumbee.com/sb-resources/sb-vehiclebreakin.md).

# SB - Vehiclebreakin

<figure><img src="/files/k3qFHl0WL0r9dIlX7hjn" alt=""><figcaption></figcaption></figure>

## SB - Vehiclebreakin

Vehicle break-in script for QB/QBX style servers with a module bridge for framework, target, notify, progressbar, inventory, and logging.

This resource is built with an escrow split:

* Open files are where you customize behavior.
* Protected files contain core anti-exploit and main runtime logic.

### Requirements

Required:

* ox\_lib (required dependency)

Supported integrations (auto-detect or manual via config):

* Framework: qbx\_core or qb-core
* Target: ox\_target or qb-target
* Inventory: ox\_inventory or qb-inventory
* Progressbar: ox\_lib, qbx\_core, or qb-core
* Notify: qbx\_core or qb-core

Important:

* This script will not function correctly without ox\_lib.

### Installation

1. Place resource in your resources folder:

* \[SB]/sb\_vehiclebreakin

2. Ensure dependency and script start order in server cfg:

* ensure ox\_lib
* ensure qbx/qb core
* ensure sb\_vehiclebreakin

3. Open and configure:

* shared/config.lua

### What You Can Edit (Open Files)

These files are safe to edit:

* shared/config.lua
* shared/api.lua
* client/main.lua
* server/main.lua
* locales/en.lua
* locales/no.lua

Protected files are loaded for runtime but are not intended for buyer edits.

### Quick Start Config (Most Common)

All main settings are in:

* shared/config.lua

Edit these first:

1. Locale and debug

* Config.Locale
* Config.Debug

2. Module selection

* Config.Modules.Framework = auto, qb, qbx
* Config.Modules.Target = auto, qb-target, ox\_target
* Config.Modules.Notify = auto, qb, qbx
* Config.Modules.ProgressBar = auto, qb, qbx, ox
* Config.Modules.Inventory = auto, qb, ox
* Config.Modules.Logger = discord

3. Loot and interaction tuning

* Config.VehicleLootChance
* Config.MaxLootDistance
* Config.TargetDistance
* Config.WindowMode = all or single
* Config.ShowSingleModeHint

4. Security and anti-spam

* Config.AntiSpam.Enable
* Config.AntiSpam.CooldownMs
* Config.Security.HardDistanceLimit

5. Police requirement gate

* Config.PoliceRequirement.Enable
* Config.PoliceRequirement.Minimum
* Config.PoliceRequirement.Jobs
* Config.PoliceRequirement.RequireOnDuty

6. Logging

* Config.Logging.Enabled
* Config.Logging.WebhookUrl
* Config.Logging.LogTypes.Loot
* Config.Logging.LogTypes.Security
* Config.Logging.LogTypes.Police
* Config.Logging.LogTypes.Evidence
* Config.Logging.LogTypes.Info
* Config.Logging.LogTypes.Warn
* Config.Logging.LogTypes.Error

### Common Customizations

#### 1) Change loot props/items/chances

Edit:

* shared/config.lua

Sections:

* Config.LootItems
* Config.VehicleClassLoot

Use this to:

* Change prop models
* Change spawn chance per entry
* Change items, min/max, and relative chance
* Disable specific vehicle classes by setting SpawnChance to 0

#### 2) Change break-in action (animation/progress/minigame)

Default action is in:

* client/main.lua

Function:

* SB.VehicleBreakInAction(playerPed, vehicleEntity)

Behavior:

* Return true to continue reward flow
* Return false to cancel

You can replace this with:

* A custom minigame
* Different animation/scenario
* Different progress logic

Base action config is in:

* shared/config.lua -> Config.SearchAction

#### 3) Change police and evidence integration

Edit:

* server/main.lua

Functions:

* SB.VehicleBreakInPolice(source, vehicleEntity, coords)
* SB.VehicleBreakInEvidence(source, vehicleEntity, coords)
* SB.GetPoliceCount()

Use this to integrate:

* Dispatch systems
* Evidence systems
* Custom police-count logic

#### 4) Change text shown to players

Edit locales:

* locales/en.lua
* locales/no.lua

Language selection:

* shared/config.lua -> Config.Locale

#### 5) Toggle external hook calls

Edit:

* shared/config.lua -> Config.ExternalHooks

Options:

* Police = true/false
* Evidence = true/false

### Window Mode Behavior

Config:

* shared/config.lua -> Config.WindowMode

Modes:

* all: requires all windows broken check path
* single: strict passenger-side behavior
  * 2-seat vehicles: front passenger side window logic
  * 4+ seat vehicles: rear passenger side window logic

Hint behavior:

* Config.ShowSingleModeHint controls whether user sees guidance when required window is still intact.

### Logging Details

Logger is Discord-based.

Config:

* shared/config.lua -> Config.Logging

How it works:

* If Config.Logging.Enabled is false, no Discord logs are sent.
* If WebhookUrl is empty, no Discord logs are sent.
* Each category is controlled by Config.Logging.LogTypes.

Common use:

* Keep Security and Error on at all times.
* Toggle Loot/Police/Evidence depending on how verbose you want logs.

### Module Detection Notes

The script supports auto-detection and manual module selection.

If a configured module is set but expected resource is not running, the script prints a warning in console.

If auto-detect cannot find a supported resource, the script falls back and prints a warning.

Detection is implemented in:

* shared/bootstrap.lua

### API Surface (Shared Wrapper)

Shared wrappers are in:

* shared/api.lua

Common wrappers used by this resource:

* SB.Notify
* SB.Progress
* SB.TargetAddGlobalVehicle
* SB.AddItem
* SB.GetJob
* SB.Webhook

Use these wrappers if you extend open files and want framework-agnostic behavior.

### Troubleshooting

#### No interaction appears on vehicles

* Check that your selected target module is installed and started.
* Verify Config.Modules.Target value in shared/config.lua.
* Verify target resource is running (ox\_target or qb-target).

#### No reward is granted

* Check distance limits:
* Config.MaxLootDistance
* Config.Security.HardDistanceLimit
* Check police gate:
* Config.PoliceRequirement
* Check your custom SB.VehicleBreakInAction returns true on success.

#### No Discord logs are sent

* Set Config.Logging.Enabled = true.
* Set a valid Config.Logging.WebhookUrl.
* Ensure the specific category in Config.Logging.LogTypes is true.

#### Wrong language displayed

* Set Config.Locale to a locale that exists in locales folder.

### Recommended First-Time Changes

1. Set Config.Locale and Config.Debug.
2. Set module values under Config.Modules.
3. Configure Config.Logging.
4. Tune Config.VehicleLootChance, Config.TargetDistance, Config.MaxLootDistance.
5. Customize Config.LootItems and Config.VehicleClassLoot.
6. If needed, override hooks in server/main.lua and action in client/main.lua.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scrumbee.com/sb-resources/sb-vehiclebreakin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
