Brutal Scripts
YouTubeDiscordStore
  • 🙉About Us
  • ↗️Translate
  • Informations
    • 🔒Escrow System
    • 🔥Common Problems
  • Scripts
    • 📄Notify
      • Accessible files
      • Installation guide
    • 🔠Text-UI
      • Installation guide
      • Exports & How to use
      • Integrations
    • 🤟Gangs
      • Accessible files
      • Installation guide
      • exports / triggers
      • Create a new gang
    • 🏡Housing
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔑Keys
      • Accessible files
      • Installation guide
      • exports / triggers
    • 💥Gang Actions
      • Accessible files
      • Installation guide
      • exports / triggers
      • Controlling the menu
    • ⭕Radial
      • Accessible files
      • Installation guide
      • Adding new buttons
    • 🎯Executions
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🐶Pets + K9 V2
      • Accessible files
      • Installation guide
    • 👮Police Job
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🚑Ambulance Job
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔧Mechanic Job
      • Accessible files
      • Installation guide
      • exports / triggers
    • 💪GYM with Skills V2
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔫Paintball
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🥊Boxing
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔨Crafting
      • Accessible files
      • Installation guide
      • Creating a new crafting table
    • 🏦Banking
      • Accessible files
      • Installation guide
      • Paycheck transactions
      • Registering transactions
    • 🎳Bowling
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🦌Hunting
      • Accessible files
      • Installation guide
    • 🏁Racing Script
      • Accessible files
      • Installation guide
    • 🐛Reports
      • Accessible files
      • Installation guide
    • 🛒Shop Robbery
      • Accessible files
      • Installation guide
    • 🛥️Yacht Heist
      • Accessible files
      • Installation guide
    • 🧾Billing
      • Accessible files
      • Installation guide
      • Triggers
    • 💰Truck Robbery
      • Accessible files
      • Installation guide
    • 🏧Atm Robbery
      • Accessible files
      • Installation guide
    • 👶Baby script
      • Installation guide
      • How to add more babys
  • Others
    • Register Key Mapping
    • Drill Minigame
    • Discord Webhook
Powered by GitBook
On this page

Was this helpful?

  1. Scripts
  2. Atm Robbery

Accessible files

Here you can find all the files which can be edite to make the asset compatible with your server.​

config.lua
Config = {
    ['Core'] = 'ESX', --  -- ESX / QBCORE | Other core setting on the 'core' folder and the client and server utils.lua
    ['BrutalNotify'] = true, -- Buy here: (4€+VAT) https://store.brutalscripts.com | Or set up your own notify (notification function)
    ['NextRobbery'] = 5,  -- minutes
    ['Item'] = 'drill',
    ['Models'] = {'prop_atm_03', 'prop_fleeca_atm', 'prop_atm_02'},
    ['RequiredCopsCount'] = 1,
    ['BagType'] = 45,
    ['CopJobs'] = {'police', 'sheriff', 'fbi'},
    ['BlipTime'] = 2, -- minutes
    ['Reward'] = { ['Min'] = 10000, ['Max'] = 20000 },
    ['Blips'] = {
        [1] = { label = 'ATM Robbery', size = 1.0, sprite = 161, colour = 1},
    },

    ['MoneySymbol'] = '$',
    ['Notification'] = {
        
        [1] =  {'ATM Robbery', "Robbery Failed!", 5000, 'info'},
        [2] =  {'ATM Robbery', "There is an ATM robbery in the City! Marked on the map!", 5000, 'info'},
        [3] =  {'ATM Robbery', "Not enough Cops in the City!", 5000, 'error'},
        [4] =  {'ATM Robbery', "You can't start the robbery now!", 5000, 'error'},
        [5] =  {'ATM Robbery', "You have got", 5000, 'info'},
        [6] =  {'ATM Robbery', "Do not spam!", 5000, 'error'},
    }
}
client-utils.lua
-- Buy here: (4€+VAT) https://store.brutalscripts.com
function notification(title, text, time, type)
    if Config.BrutalNotify then
        exports['brutal_notify']:SendAlert(title, text, time, type)
    else
        -- Put here your own notify and set the Config.BrutalNotify to false
        TriggerEvent('brutal_shop_robbery:client:DefaultNotify', text)
    end
end

RegisterNetEvent('brutal_shop_robbery:client:DefaultNotify')
AddEventHandler('brutal_shop_robbery:client:DefaultNotify', function(text)
    SetNotificationTextEntry("STRING")
    AddTextComponentString(text)
    DrawNotification(0,1)

    -- Default ESX Notify:
    --TriggerEvent('esx:showNotification', text)

    -- Default QB Notify:
    --TriggerEvent('QBCore:Notify', text, 'info', 5000)
end)

RegisterNetEvent('brutal_atm_robbery:client:PoliceAlertBlip')
AddEventHandler('brutal_atm_robbery:client:PoliceAlertBlip', function(coords)

    -- notify function
    notification(Config['Notification'][2][1], Config['Notification'][2][2], Config['Notification'][2][3], Config['Notification'][2][4])
    
    -- blip for the cops
    AlertAtm = AddBlipForCoord(coords.x, coords.y, coords.z)
    SetBlipSprite(AlertAtm, Config['Blips'][1]['sprite'])
    SetBlipScale(AlertAtm, Config['Blips'][1]['size'])
    SetBlipColour(AlertAtm, Config['Blips'][1]['colour'])
    BeginTextCommandSetBlipName('STRING')
    AddTextComponentSubstringPlayerName(Config['Blips'][1]['label'])
    EndTextCommandSetBlipName(AlertAtm)

    Citizen.Wait(1000*60*Config['BlipTime'])
    RemoveBlip(AlertAtm)
end)
server-utils.lua
local YourWebhook = 'WEBHOOK-HERE'  -- help: https://docs.brutalscripts.com/site/others/discord-webhook

function GetWebhook()
    return YourWebhook
end

-- Buy here: (4€+VAT) https://store.brutalscripts.com
function notification(source, title, text, time, type)
    if Config.BrutalNotify then
        TriggerClientEvent('brutal_notify:SendAlert', source, title, text, time, type)
    else
        TriggerClientEvent('brutal_shop_robbery:client:DefaultNotify', text)
    end
end

RegisterServerEvent("brutal_atm_robbery:server:PoliceAlert")
AddEventHandler("brutal_atm_robbery:server:PoliceAlert", function(coords)
    local source = source
	local xPlayers = GetPlayersFunction()
	
	for i=1, #xPlayers, 1 do
        for ii=1, #Config['CopJobs'] do
            if GetPlayerJobFunction(xPlayers[i]) == Config['CopJobs'][ii] then
            TriggerClientEvent("brutal_atm_robbery:client:PoliceAlertBlip", xPlayers[i], coords)
            end
        end
    end
end)
client-core.lua
Core = nil

if Config['Core']:upper() == 'ESX' then
    
    local _esx_ = 'new' -- 'new' / 'old'

    if _esx_ then
        Core = exports['es_extended']:getSharedObject()
    else
        while Core == nil do
            TriggerEvent('esx:getSharedObject', function(obj) Core = obj end)
            Citizen.Wait(0)
        end
    end
    
    TSCB = Core.TriggerServerCallback
    PlayerDiedHealth = 0

elseif Config['Core']:upper() == 'QBCORE' then

    Core = exports['qb-core']:GetCoreObject()
    TSCB = Core.Functions.TriggerCallback
    PlayerDiedHealth = 100

end
server-core.lua
Core = nil

if Config['Core']:upper() == 'ESX' then
--------------------------------------------------------------------------
---------------------------------| ESX |----------------------------------
--------------------------------------------------------------------------

    local _esx_ = 'new' -- 'new' / 'old'
            
    if _esx_ == 'new' then
        Core = exports['es_extended']:getSharedObject()
    else
        Core = nil
        TriggerEvent('esx:getSharedObject', function(obj) Core = obj end)
        while Core == nil do
            Citizen.Wait(0)
        end
    end

    RESCB = Core.RegisterServerCallback
    GETPFI = Core.GetPlayerFromId
    RUI = Core.RegisterUsableItem

    function GetPlayersFunction()
        return Core.GetPlayers()
    end

    function AddMoneyFunction(source, amount)
        local xPlayer = GETPFI(source)

        xPlayer.addAccountMoney('money', amount) -- NORMAL MONEY
        --xPlayer.addAccountMoney('black_money', amount) -- BLACK MONEY
    end

    function GetPlayerJobFunction(source)
        local xPlayer = GETPFI(source)
        PlayerJob = xPlayer.job.name
        return PlayerJob
    end

    function RemoveItem(source, item, amount)
        local xPlayer = GETPFI(source)
        xPlayer.removeInventoryItem(item, amount)
    end

    function GetIdentifierFunction(source)
        local xPlayer = GETPFI(source)
        return xPlayer.identifier
    end

elseif Config['Core']:upper() == 'QBCORE' then
--------------------------------------------------------------------------
--------------------------------| QBCORE |--------------------------------
--------------------------------------------------------------------------

    Core = exports['qb-core']:GetCoreObject()
    
    RESCB = Core.Functions.CreateCallback
    GETPFI = Core.Functions.GetPlayer
    RUI = Core.Functions.CreateUseableItem

    function GetPlayersFunction()
        return Core.Functions.GetPlayers()
    end

    function AddMoneyFunction(source, amount)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.AddMoney('cash', amount)
    end

    function GetPlayerJobFunction(source)
        local xPlayer = GETPFI(source)
        PlayerJob = xPlayer.PlayerData.job.name
        return PlayerJob
    end

    function RemoveItem(source, item, amount)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.RemoveItem(item, amount)
    end

    function GetIdentifierFunction(source)
        local xPlayer = GETPFI(source)
        return xPlayer.PlayerData.citizenid
    end
    
end
PreviousAtm RobberyNextInstallation guide

Last updated 1 year ago

Was this helpful?

🏧