[Release][ESX][Abandoned] New Reworked Bank Robbery System

es_extended was update many times lately, i didnt test or made improvements to working with the newest es_extended versions, so i cant give support for that. Anyway thx for the reports, probably i should write a advise about bugs on newest esx versions

once again this seems a problem with the latest es_extended versions and probably it will not work, you can try to delete the dependency line on _resource.lua file but nothing is guaranteed to work

i have tried to delete essentialmode dependency but the script didnt work
error comes up in F8

@blackcould45 that is because the function calls have the parameters back to front.

https://esx-org.github.io/es_extended/client/functions/game/getclosestobject/

The documents state: ESX.Game.GetClosestObject(coords, modelFilter). This script uses the door type then the coords. However it still won’t work as is with this change.

I have it working using the below instead, which only needs to be defined once per function not within the while dooropen loop also:

local obs, distance = GetClosestObjectOfType(coords, 1.0, GetHashKey(doortype), false, false, false)

The code for closing the doors after 300 seconds will need to be updated to force the doors to close again

Ozzie

1 Like

My updated code that works fine with latest ESX is below, please feel free to use it and if the owner wants to adapt it please do so as its a very good mod.

RegisterNetEvent(‘esx_holdupbank:plantedbomb’)
AddEventHandler(‘esx_holdupbank:plantedbomb’, function(x,y,z,doortype)
local coords = vector3(x,y,z) – fix for vectors
local obs, distance = GetClosestObjectOfType(coords, 1.0, GetHashKey(doortype), false, false, false)
–AddExplosion( bank.bombposition.x, bank.bombposition.y, bank.bombposition.z , 0, 0.5, 1, 0, 1065353216, 0)
AddExplosion( x, y, z , 0, 0.5, 1, 0, 1065353216, 0)
AddExplosion( x, y, z , 0, 0.5, 1, 0, 1065353216, 0)
– AddExplosion( bank.bombposition.x, bank.bombposition.y, bank.bombposition.z , 0, 0.5, 1, 0, 1065353216, 0)
local rotation = GetEntityHeading(obs) + 47.2869
SetEntityHeading(obs,rotation)
globalbombcoords = coords
globalbombrotation = rotation
globalbombDoortype = doortype
Citizen.CreateThread(function()
while dooropen do
Wait(2000)
SetEntityHeading(obs, 47.2869)
–Citizen.Wait(0);
end
Wait(120000) --Give them 120 seconds to leave the safe before door locks
SetEntityHeading(obs, 160.00001525879)
end)
end)

RegisterNetEvent(‘esx_holdupbank:opendoors’)
AddEventHandler(‘esx_holdupbank:opendoors’, function(x,y,z,doortype)
dooropen = true;
ESX.ShowNotification("X: "…x)
local coords = vector3(x,y,z) – fix for vectors
local obs, distance = GetClosestObjectOfType(coords, 1.0, GetHashKey(doortype), false, false, false)
local pos = GetEntityCoords(obs);
local rotation = GetEntityHeading(obs) + 70
–[[ globalcoords = coords
globalrotation = rotation
globalDoortype = doortype
–]]
Citizen.CreateThread(function()
while dooropen do
Wait(2000)
SetEntityHeading(obs, 0.0)
end
Wait (120000) --Give them 120 seconds to leave the safe before door locks
SetEntityHeading(obs, 250.0)
end)
end)

3 Likes

how to make people get dirty money as reward ?

how can i change the position of rob time? left bottom near radar to bottom center

9/10 This scripts works fine for the newest version but the
C4 Explosion doens’t work for me.

Also take a look at the error message from the console:

LIFE SAVER! THANKS

hey i dont have in my sql the hacking tools and everytime i go to the bank to rob it i press E and nothing happens… (i dont receive any error) do you know how to fix it?

Install the script “mhacking”

@Knatus53 How can I get the objects in my inventory ? I filled all the “start” ressources, but they are not on me and therefore, cannot use them. I tried to spawn them with the names they have into the .sql, but no can do

Also, I tried to add 2 cops required into the config file. Now, if I try to rob one bank, it says “cops required:” with no numbers or anything, and no cops around the bank, and globally, I cannot start the robbery. I am missing something but don’t see what.

@MoravianLion Is there a way to use the robbery script on a single player ESX server, while no cops are on duty, but using eventually the AI cops. Maybe an alarm can be triggered by the end, and they start arriving, or something ?

@Knatus53 same question on your script.

Of course there is. Unfortunately, I won’t be able to do it for you. I am not active in FiveM anymore. I would have to dive in the code again and that’s something I don’t want to right now.

It shouldn’t be that difficult though. This might be a great exercise for someone looking to start coding.

wink, wink

1 Like

The best answer for that is the answer from @MoravianLion

@Knatus53 @MoravianLion I wish I would know coding enough to find the way to do that. I tried a bit modifying things, but no luck so far.

To all this people which cant start because they dont have esx_knatusblowtorch, read and follow carefully all installation steps on github

Can you update esx_knatusblowtorch?main.lua/45 is error.
plz

So yeah I tried to add this to an sESX server and it seems to not open the phone to hack the door does anyone know how I can solve this?

Do you have the mHacking script installed?