Possible ATM Robberies (Hacking)

Hey, I hope everyone’s having a great weekend!

Here’s an ATM Robbery script I made today, thought it could be useful for others so I made it compatible with qb-target, inv and progress.

Preview:

Features:

  • Animation & Prop during Hacking minigame

  • Minimum Police Required

  • ox_inventory, ox_target & ox_lib comptaible

  • qb-inventory, qb-target comptaible

  • Open-Source

Config:

Repo:

  • README has ps-dispatch call I use, but you can easily just put whatever dispatch you use in place.

Dependencies:
MHacking

IF YOU DO NOT WANT TO USE OX_LIB, SIMPLY COMMENT IT OUT IN THE FXMANIFEST

README has ps-dispatch call I use, but you can easily just put whatever dispatch you use in place.

Code is accessible Yes
Subscription-based Yes/No
Lines (approximately) Number of lines
Requirements qb-core, mhacking
Support Yes/No
5 Likes

what chat script are you using?

It’s m-Chat by CodeM

Hey it seemed like there is an issue with the script. I have it solved already and edited the code. its not a drag and drop. 1. I had to add it to qb-targets manually. 2. when it gave out the money, it was not giving the markedbills any worth. so i had to get a reference for it to work. A few tweaks and got it correctly working. amazing script.

1 Like

Hey man, feel free to PR these will take a look over.

I did test on a base qb-core Dev server but then did a little more work on the ox side on my main server, will apply your changes and test them if you PR! It is setup primarily for dirty cash as an item, so likely a little scuffed with Marked Bills without some altering thinking about it

Server.lua

RegisterServerEvent(‘possible-atm-robbery:giveReward’)
AddEventHandler(‘possible-atm-robbery:giveReward’, function()
local src = source
local xPlayer = QBCore.Functions.GetPlayer(src)
local bags = math.random(1,2)
local info = {
worth = math.random(Config.MinReward, Config.MaxReward)
}
if Config.InventoryType == “qb-inventory” then
if xPlayer.Functions.AddItem(Config.DirtyCashType, bags, false, info) then
TriggerClientEvent(‘inventory:client:ItemBox’, src, QBCore.Shared.Items[Config.DirtyCashType], “add”)
end
elseif Config.InventoryType == “ox_inventory” then
ox_inventory:AddItem(src, Config.DirtyCashType, reward)
end
end)

qb-targets/init.lua
find “Config.TargetModels”
add this

[“Hack ATM”] = {
models = {
prop_atm_01,
prop_atm_02,
prop_atm_03,
prop_fleeca_atm,
},
options = {
{
name = ‘possible-atm:hackATM’,
event = ‘possible-atm:startHack’,
icon = ‘fa-solid fa-user-ninja’,
label = ‘Hack ATM’,
item = ‘atmhacker’,
action = function()
TriggerEvent(‘possible-atm-robbery:startHack’)
end
}
},
distance = 2.5,
},

This is what I did, Dont believe i did anything else for it to work.
qb-core already has markedbills so instead of giving them quantity it gives them “bags” between random 1-2. the worth is still the same in the config. again amazing script great work

Great, if you could fork and make a pull request with the above I can review it properly and merge it into the main branch.