[Release] [ESX] Drill Item + Bank Rob Edit

Hello. I’ve seen a lot of requests on this plugin combination and I decided to mix something up by edit a simple item plugin since I’m new to coding don’t be suprised if you find any bugs!

Credit goes to Github @ TanguyOrtegat release of esx_holdupbank. Editing of his Plugin.
Credit goes to Github @ johanwulf release of esx_cigarett. Used his plugin to make this Drill.

Feel free to make commits to the plugins!

My Github:
Click Me

Get both of the plugins here:
ESX Drill
ESX HoldUpBank

Known Issues:
You can cancel the drill animation at any time and still keep on robbing till the timer runs out.

Installation:
Upload both to resources/[esx] folder.
Add these to server.cfg

start esx_borrmaskin
start esx_holdupbank

Create “drill” in items table. ( You can change Borrmaskin to whatever name you like )

INSERT INTO `items` (`name`, `label`, `limit`) VALUES  
    ('drill', 'Borrmaskin', 1)
;

If you want the Drill to be added to esx_shops insert this SQL Query into shops.

INSERT INTO `shops` (name, item, price) VALUES
	('TwentyFourSeven','drill',1000),
	('RobsLiquor','drill',1000),
	('LTDgasoline','drill',1000)
;

To test it out ingame type /giveitem playerid drill 1.
Edit config.lua

Config.NumberOfCopsRequired = 1

To

Config.NumberOfCopsRequired = 0

in esx_holdupbank or you can just set yourself as a cop and do the robbery.

Update

If you want to add the drill to be buyable from a gang add this in server.lua. Remember to replace esx_cartel, society_cartel with proper job names etc.

RegisterServerEvent('esx_cartel:buyItem')
AddEventHandler('esx_cartel:buyItem', function()
  	TriggerEvent('esx_addonaccount:getSharedAccount', 'society_cartel', function(account)
	TriggerEvent('esx_addoninventory:getSharedInventory', 'society_cartel', function(inventory)

		if account.money >= 250000 then
		
		  TriggerClientEvent('esx:showNotification', source, 'Du har köpt en borrmaskin för $250000')
		  
		  inventory.addItem('drill', 1)
		  account.removeMoney(250000)
		  
		else
		  TriggerClientEvent('esx:showNotification', source, 'Medges ej')
		end

	end)
	end)
end)

Then add this in client.lua

		if data.current.value == 'get_drill' then
			TriggerServerEvent('esx_cartel:buyItem')
		end
13 Likes

so u basicly need this for a bank rob?

Yes. You need the drill item to be able to rob the bank. When you start to rob you use the drill item and an animation starts.

for all robs or just the big bank? :smiley:

Just bank.

(20 characters)

Instead of using /give, why not have the player buy the drill item at a store?

1 Like

You can do that if you want it to. I added it so a gang sells it on my server. Let me add a SQL query for shops.

1 Like

Added it in shops, works fine, love it thanks<3

2 Likes

Glad to be able to help :slight_smile:

1 Like

YES.
Great work, loving it!!!

1 Like

does this script also help with a global cooldown so if someone robs a store they cant rob another store for a certain amount of time.

It’s holdupbank. You can only rob banks with this one. I think the cooldown is global between the banks.

Alright so i made I’m trying to add that to the shops table but its not letting me…
What am i doing wrong @Roddan

It was a mistake made by me sorry.

Remove

, 

from this line after 1000)

('LTDgasoline','drill',1000)
1 Like

Mine gets to 0 seconds without nothing happening any idea?
It is a great script tho. Well done you

You need ES Extended since it gives you dirty money.

I do have es_estended tuning smooth. I change the time to 10 second to test the script and that was the only hangs I made. Anything else that comes to your mind that might be corrupting the script?
Thanks for the help man

Did you also edit this line in server/server.lua?

600000 = 600 seconds in MS.

SetTimeout(600000, function()

I haven’t Roddan. I’m not at home now but I’ll test it ASAP and I’ll get back to you. Thanks for the prompt response.

Any pictures? 20 charachters