[RELEASE] EssentialMode Robbery System

Found an error.

this is referencing line 520 which states;

				local randomAmount = math.random(aFourth,aFourth*3)

the whole code:
from line 514 to 529

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(1800000)
		for name,spot in pairs(robbableSpots)do
			if(spot.isBank==false)then
				local aFourth = spot.currentMoney/4
				local randomAmount = math.random(aFourth,aFourth*3)
				spot.currentMoney = spot.currentMoney-randomAmount
				robbableSpots[spot.bankToDeliverToo].currentMoney=robbableSpots[spot.bankToDeliverToo].currentMoney+randomAmount
				if(robbableSpots[spot.bankToDeliverToo].currentMoney>robbableSpots[spot.bankToDeliverToo].maxMoney)then
					robbableSpots[spot.bankToDeliverToo].currentMoney=robbableSpots[spot.bankToDeliverToo].maxMoney
				end
			end
		end
	end
end)

I fixed the problem. Before i pushed i removed two parantehsis by accident. Has been fixed, just tested it and it is working. I dont use essential mode so i had to make some modifications for this to work in a public release. My bad guys.

Hey, great release! Do police get notified?

That would be the whole point of a robbery script,
Dont u think

All I get is “Press E to start prying open the cash register”
I press E,
nothing.
any ideas? No errors in console.

6 Likes

You need ot have the cops on duty probally. Set the cops needed for robbery to 0 and the cops needed for the spot your testing to 0. Or how ever many you are testing with. I had a variable that overides the amount of cops needed to rob in a way. So if you set the cops needed per robbery in the config to 2, the ones that require 1 , will still need 2.

Okay, that was able to get it for testing. However, I had someone rob the store, and it sent no notifications to any cops.
It was only sending notifications out to the client side of the person who triggered the alarm. It sent all notifications it should, but only to the person who triggered it.

i can not get this to turn on as well. i have modified for testing and get no prompts

I modified for test i get the prompt but when I press E to pry it open nothin happens

I have fixed all the bugs, sorry, i was finally at my PC again with free time so i could test it properly. Notifications shoudl show up for everyone now. I ported it real quick for essential mode and i use my own notification system. Just switched the two notification events and didnt even think abouti t. Should be working now.

1 Like

Any ideas on how to remove the sound for every second it counts down?

Literally won’t work, notifications still will not send. I can rob stuff, but it’s pointless for me at the moment without notifications.

You need pNotify. :stuck_out_tongue:

it says at the top you need pnotify.

Is this compatible with esx?

Very nice release.

Im pretty sure esx just extends essential mode so it should…

Yea, I’ve got pNotify and all that. I make sure to read the topic, however it never sends a notification to anyone.

@Damien_Ostler Why is it sending The pNotify Message Client Side, Shouldn’t It Be Sent Server Side So Then People That Don’t Use Cops FiveM Can Still See The Robbery Message/

This requires cops fivem tod etermine how many cops are on and etc anyways, sooo, no.

So it requires Cops FiveM? Why doesn’t it say that?