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 & Props (now utilising emote menus to simplify)
-
Minimum Police Required
-
Police dispatch
-
ox_inventory, ox_target & ox_lib comptaible
-
qb-inventory compat
-
Open-Source
Download:
Dependencies:
- mHacking
- ox_inventory or qb-inventory
- ox_lib
- ox_target
- rpemotes or scully_emotemenu
10 Likes
what chat script are you using?
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.
2 Likes
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.
This has had a bit of a rewrite today, lots of stuff simplified and tidied up.
Should also now be ESX compat (need to test). 
1 Like
@Possible_o sv_dispatchcodes.lua and cl_extraalerts.lua no longer exist. It was no longer usable!
It’s still useable the dispatch code just needs updating, feel free to do a PR - otherwise I’ll update at some point this week 