Skip to content

Commit

Permalink
Make chance to get safe code configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
citRaTTV committed Dec 10, 2023
1 parent dd935b4 commit 1809c29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Config.RegisterEarnings = math.random(Config.minEarn, Config.maxEarn)
Config.MinimumStoreRobberyPolice = 2
Config.resetTime = (60 * 1000) * 30
Config.tickInterval = 1000
Config.stickyNoteChance = 10 -- Percent chance to get the safe code from a cash register

Config.Registers = {
[1] = { vector3(-47.24, -1757.65, 29.53), robbed = false, time = 0, safeKey = 1, camId = 4 },
Expand Down
2 changes: 1 addition & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RegisterNetEvent('qb-storerobbery:server:takeMoney', function(register, isDone)
}
Player.Functions.AddItem('markedbills', bags, false, info)
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['markedbills'], 'add')
if math.random(1, 100) <= 10 then
if math.random(1, 100) <= Config.stickyNoteChance then
local code = SafeCodes[Config.Registers[register].safeKey]
if Config.Safes[Config.Registers[register].safeKey].type == 'keypad' then
info = {
Expand Down

0 comments on commit 1809c29

Please sign in to comment.