From 1809c29fcbd98a902742637e6d26b3fa1076cdd3 Mon Sep 17 00:00:00 2001 From: citRa Date: Sun, 10 Dec 2023 16:48:03 -0400 Subject: [PATCH] Make chance to get safe code configurable --- config.lua | 1 + server/main.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config.lua b/config.lua index 44e97b5..5995c42 100644 --- a/config.lua +++ b/config.lua @@ -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 }, diff --git a/server/main.lua b/server/main.lua index cd52a44..1c21bd4 100644 --- a/server/main.lua +++ b/server/main.lua @@ -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 = {