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.
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
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
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