> For the complete documentation index, see [llms.txt](https://shift-studios.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shift-studios.gitbook.io/docs/old-free/editor-5.md). Agents can also search and read this documentation through its [MCP server](https://shift-studios.gitbook.io/docs/~gitbook/mcp).

# Search

Transform Your Server With Shift Studios — Powerful, Optimized, And Reliable Resources Built To Improve Every Experience.

<figure><img src="https://4062160621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgqh3gjuJzDAWNXTD9sEE%2Fuploads%2FwIbcylzCz6CvtEYGtltR%2Fsearch.png?alt=media&amp;token=4787ec93-d348-4d17-bb19-b662ec615c2c" alt=""><figcaption></figcaption></figure>

### Installation

{% stepper %}
{% step %}

### Search

Read Everything Below To Install
{% endstep %}

{% step %}

### Ensure All Dependencies Are Installed

```
Required: None

Framework Support: ESX, QBCore, Qbox & Standalone

Inventory Support: Multiple Configurable Inventory Systems

Target Support: Multiple Configurable Target Systems

Notification Support: Multiple Configurable Notification Systems

Framework, Inventory, Target & Notification Detection Can Be Automatically Or Manually Configured.
```

{% endstep %}

{% step %}

### Drag & Drop

Drag & Drop The Resource Into Your FiveM Server
{% endstep %}

{% step %}

### Ensure The Resource

Make Sure To Ensure shift-search In Your Server CFG.
{% endstep %}

{% step %}

### Configure The Resource

{% code expandable="true" %}

```lua
-- 💠 ███████╗██╗  ██╗██╗███████╗████████╗    ███████╗████████╗██╗   ██╗██████╗ ██╗ ██████╗ ███████╗ 💠
-- 🔷 ██╔════╝██║  ██║██║██╔════╝╚══██╔══╝    ██╔════╝╚══██╔══╝██║   ██║██╔══██╗██║██╔═══██╗██╔════╝ 🔷
-- 🌀 ███████╗███████║██║█████╗     ██║       ███████╗   ██║   ██║   ██║██║  ██║██║██║   ██║███████╗ 🌀
-- 🔹 ╚════██║██╔══██║██║██╔══╝     ██║       ╚════██║   ██║   ██║   ██║██║  ██║██║██║   ██║╚════██║ 🔹
-- 💎 ███████║██║  ██║██║██║        ██║       ███████║   ██║   ╚██████╔╝██████╔╝██║╚██████╔╝███████║ 💎
-- 🔵 ╚══════╝╚═╝  ╚═╝╚═╝╚═╝        ╚═╝       ╚══════╝   ╚═╝    ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝ 🔵

Config = {}

Config.Debug = false

-- Framework: 'auto', 'esx', 'qb', 'qbox', 'standalone'
Config.Framework = 'esx'

-- Inventory: 'auto', 'ox_inventory', 'qb-inventory', 'ps-inventory',
-- 'qs-inventory', 'codem-inventory', 'tgiann-inventory', 'framework', 'custom'
-- You can also enter another inventory resource name directly. Shift Search will try
-- standard AddItem / CanCarryItem / Items exports before falling back to Config.Custom.
Config.Inventory = 'ox_inventory'

-- Notifications: 'auto', 'ox_lib', 'qb', 'qbox', 'esx', 'okok', 'custom'
Config.Notifications = 'ox_lib'

-- Interaction: 'auto', 'ox_target', 'qb-target', 'qtarget', 'text'
-- Auto uses a supported target resource when available and falls back to text interaction.
Config.Interaction = 'ox_target'

Config.Theme = {
    accent = '#0001fc',
    logo = 'https://r2.fivemanage.com/BY7ePdGhOIyQZylpoqgVy/shiftstudioslogopng.png'
}

Config.Target = {
    label = 'Search Trash',
    icon = 'fas fa-trash',
    distance = 2.0
}

Config.TextInteraction = {
    key = 38, -- E
    distance = 1.8,
    text = '[E] Search Trash'
}

-- Minigame / progress settings.
-- The minigame is shown first by itself. After it is completed successfully,
-- it closes and the Shift progress bar is shown by itself.
Config.Search = {
    minigameDuration = 12000,
    duration = 5000, -- Progress bar duration in milliseconds.
    maxAttempts = 5,
    canCancel = true,
    disableMovement = true,
    disableCombat = true,
    animation = {
        enabled = true,
        dict = 'amb@prop_human_bum_bin@base',
        clip = 'base',
        flag = 1
    },
    ui = {
        title = 'Trash Search',
        subtitle = 'Rummage Through The Trash And Find The Useful Item.',
        progressTitle = 'Searching Trash',
        progressText = 'Rummaging Through The Container.',
        cancelLabel = 'Cancel Search'
    }
}

-- Cooldowns are applied server-side PER TRASH CONTAINER.
-- There is intentionally no global/player cooldown. Searching one can only
-- places that exact can on cooldown; other cans remain searchable.
Config.Cooldowns = {
    trash = 60,       -- Seconds before the exact trash container can be searched again.
    onFailure = true,
    onCancel = false
}

Config.Security = {
    validationDistance = 4.0,
    reservationGrace = 5,       -- Extra seconds added to the search reservation timeout.
    minimumCompletionTime = 400, -- Milliseconds. Helps reject impossible instant-complete events.
    progressCompletionTolerance = 500, -- Allowed timing tolerance when validating the progress stage.
    requestRateLimit = 750       -- Anti-event-spam only; this is not a gameplay/player cooldown.
}

Config.TrashProps = {
    `prop_bin_01a`,
    `prop_bin_02a`,
    `prop_bin_03a`,
    `prop_bin_05a`,
    `prop_cs_bin_01`,
    `prop_dumpster_01a`,
    `prop_dumpster_02a`,
    `prop_dumpster_3a`,
    `prop_dumpster_4a`
}

-- Chance to complete a successful minigame but find nothing useful.
Config.EmptyChance = 10

-- Reward tables are checked in this order: RareRewards -> RareItems -> Rewards.
-- The first successful chance roll is awarded.
Config.Rewards = {
    { item = 'ammo-9', min = 10, max = 40, chance = 50 },
}

Config.RareItems = {
    { item = 'WEAPON_SWTICHBLADE', min = 1, max = 1, chance = 35 },
}

Config.RareRewards = {
    { item = 'money', min = 100, max = 200, chance = 25 },
}

Config.Notify = {
    duration = 5000,
    position = 'center-left',

    trashCooldown = {
        title = 'Shift Search',
        description = 'This Trash Was Just Searched',
        type = 'error'
    },
    alreadySearching = {
        title = 'Shift Search',
        description = 'You Are Already Searching Something',
        type = 'error'
    },
    cancelled = {
        title = 'Shift Search',
        description = 'Search Cancelled',
        type = 'error'
    },
    failed = {
        title = 'Shift Search',
        description = 'You Did Not Find Anything Useful',
        type = 'inform'
    },
    empty = {
        title = 'Shift Search',
        description = 'You Found Nothing Useful',
        type = 'inform'
    },
    rareFind = {
        title = 'Shift Search',
        description = 'You Found {amount}x {item}',
        type = 'success'
    },
    itemFind = {
        title = 'Shift Search',
        description = 'You Found {amount}x {item}',
        type = 'success'
    },
    inventoryFull = {
        title = 'Shift Search',
        description = 'You Do Not Have Enough Inventory Space',
        type = 'error'
    },
    invalidSearch = {
        title = 'Shift Search',
        description = 'That Search Could Not Be Verified',
        type = 'error'
    }
}

--==========================================================--
-- Custom Integration Hooks
--==========================================================--
-- These hooks let unsupported/custom resources plug in without editing core files.

Config.Custom = {
    notify = function(data)
        -- data.title, data.description, data.type, data.duration, data.position
        -- Return true if your notification was handled.
        return false
    end,

    addItem = function(source, item, amount, metadata)
        -- Return true when the item was successfully added.
        return false
    end,

    canCarryItem = function(source, item, amount, metadata)
        -- Return true/false to enforce capacity, or nil to skip a pre-check.
        return nil
    end,

    getItemLabel = function(item)
        -- Return a display label or nil to use the item name.
        return nil
    end
}

```

{% endcode %}
{% endstep %}

{% step %}

### Restart / Start Your Server

Ensure Everything Is Working Well & Enjoy !!
{% endstep %}
{% endstepper %}
