[FREE][QB/ESX] Ran Store Robbery

Ran Store Robbery

Hi I’m ranran, this is the third script that I made!

Preview: Youtube
Github repo: here
Docs: here

Feature:

  • Ability to hack the alarm (it makes the alarm delayed)
  • Fun minigames when loot the register and hack the alarm using ran minigames

Dependencies:

Icon Description
:white_check_mark: Supported
:x: Not Supported
:o: WIP

Supported Framework:

  • [:white_check_mark:] QBCore
  • [:white_check_mark:] ESX
  • [:o:] OX

Supporeted Inventory:

  • [:white_check_mark:] ox inventory
  • [:white_check_mark:] qb inventory
  • [:white_check_mark:] lj inventory
  • [:white_check_mark:] ps inventory

Supported Target:

  • [:white_check_mark:] ox target
  • [:white_check_mark:] qb target
  • [:x:] bt target

Dispatch:

  • [:white_check_mark:] PS Dispatch

You’re free to add compatibility to the script and create a pr

17 Likes

I ultra love the Script, but i would also love to see a qb-inventory & qb-target integration <3

1 Like

I agree, if anything I’ll try to add some sort of support. If I’m successful I’ll PR it

1 Like

qb inventory and qb target support are on the way

1 Like

Update: qb inventory and qb target are now supported. Make sure you set stickynote item to useable

2 Likes

do u have any preliminary date of when is esx comming ?

Hello! I’m getting this error after passing memory game when robbing a store
https://i.imgur.com/SWWkE92.png

Update: ESX Legacy are now supported

1 Like


This happens when you put the code in the safe.
It says the code is correct and it doesn’t open

Try replacing the RegisterSafe function to this

function Functions.RegisterSafe(storeid, items)
    local config = Config.Store[storeid]
    if not config then return end
    if config.safe.opened and config.safe.id then return end
    if Config.Inventory == "qb" then
        local stashid = RandomStr(2) .. RandomInt(2) .. RandomStr(2)
        for _, v in pairs(items) do
            ---@type string
            local itemname = v[1]
            if not itemname then
                warn("Itemname doesn't exist...")
            end
            ---@type number
            local itemCount = v[2]
            local itemInfo = itemname and QBCore.Shared.Items[itemname]
            if itemInfo then
                items[#items + 1] = {
                    name = itemInfo.name,
                    amount = tonumber(itemCount),
                    info = {},
                    label = itemInfo.label,
                    description = itemInfo.description ~= nil and itemInfo.description or "",
                    weight = itemInfo.weight,
                    type = itemInfo.type,
                    unique = itemInfo.unique,
                    useable = itemInfo.useable,
                    image = itemInfo.image,
                    slot = #items + 1
                }
            else
                warn("Can't find iteminfo for " .. itemname or "Unknown")
            end
        end
        MySQL.insert.await(
            "INSERT INTO stashitems (stash, items) VALUES (:stash, :items) ON DUPLICATE KEY UPDATE items = :items", {
                ['stash'] = stashid,
                ['items'] = json.encode(items)
            })
        return stashid
    elseif Config.Inventory == "ox" then
        return ox_inventory:CreateTemporaryStash({
            label = "Safe",
            slots = 10,
            maxWeight = 100000,
            items = items
        })
    end
end
1 Like

Its doesn’t give error, but i still can’t open safe

same issue here, i swapped to the function above, but it still doesn’t physically open the Safe Stash, doesnt show the Press [E] to open.

Where do we insert the discord Webhook link, as it gives us error message that its missing. Thx in advance

Sadly im pretty sure Ran passed away

1 Like

Nope, doesn’t work

Hi, have you thought about a global cooldown for doing this heist?

Came across this script and liked the idea and minigames, I also ran into some issues with the safe but have since fixed this.

If you or anyone else is interested and are running into this issue, (Seems to be QB related) I have updated the RegisterSafe function to work with current QB-Inv.

With this modification, the Functions.RegisterSafe function should work in conjunction with the GetStashItems function.

function Functions.RegisterSafe(storeid, items)
    local config = Config.Store[storeid]
    if not config then return end
    if config.safe.opened and config.safe.id then return end
    if Config.Inventory == "qb" then
        local stashid = RandomStr(2) .. RandomInt(2) .. RandomStr(2)
        local newItems = {}  -- Create a new table to hold the modified items
        for _, v in pairs(items) do
            local itemname = v[1]
            if not itemname then
                warn("Itemname doesn't exist...")
            end
            local itemCount = v[2]
            local itemInfo = itemname and QBCore.Shared.Items[itemname]
            if itemInfo then
                newItems[#newItems + 1] = {
                    name = itemInfo.name:lower(),
                    amount = tonumber(itemCount),
                    info = {},
                    label = itemInfo.label,
                    description = itemInfo.description ~= nil and itemInfo.description or "",
                    weight = itemInfo.weight,
                    type = itemInfo.type,
                    unique = itemInfo.unique,
                    useable = itemInfo.useable,
                    image = itemInfo.image,
                    slot = #newItems + 1
                }
            else
                warn("Can't find iteminfo for " .. (itemname or "Unknown"))
            end
        end
        MySQL.insert.await(
            "INSERT INTO stashitems (stash, items) VALUES (:stash, :items) ON DUPLICATE KEY UPDATE items = :items", {
                ['stash'] = stashid,
                ['items'] = json.encode(newItems)  -- Use the modified items table
            })
        return stashid
    elseif Config.Inventory == "ox" then
        return ox_inventory:CreateTemporaryStash({
            label = "Safe",
            slots = 10,
            maxWeight = 100000,
            items = items
        })
    end
end

Hope this helps :slight_smile:

2 Likes

ok i cant make it so it give me direct money (cash)
and I cant fix the safe I hack it give me pin but never open the safe

1 Like

can you release this for using ox_lib without ox target or any target script?

Is there a way to change the way it gives the money? It gives in amounts right now vs a the default qbcore markedbills. I will post a screenshot. https://i.imgur.com/xfHj2Hv.png