From 89a764304b09eaaaff1cd8086a27dabb1158da39 Mon Sep 17 00:00:00 2001 From: BreezyTheDev <63890993+BreezyTheDev@users.noreply.github.com> Date: Tue, 23 Aug 2022 20:45:09 -0700 Subject: [PATCH] BAC Level error resolved. If accidentally or mistakenly entered any letters in the text box it returned an error and won't allow you to open the menu again. I resolved the issue by checking if it was nil. Let me know if you have any questions. --- menu.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/menu.lua b/menu.lua index 0a034d1..268cf2c 100644 --- a/menu.lua +++ b/menu.lua @@ -760,10 +760,14 @@ function Menu() end TriggerServerEvent('SEM_InteractionMenu:BACSet', tonumber(BACLevel)) - if tonumber(BACLevel) < 0.08 then - Notify('~b~BAC Level Set: ~g~' .. tostring(BACLevel)) + if tonumber(BACLevel) ~= nil then + if tonumber(BACLevel) < 0.08 then + Notify('~b~BAC Level Set: ~g~' .. tostring(BACLevel)) + else + Notify('~b~BAC Level Set: ~r~' .. tostring(BACLevel)) + end else - Notify('~b~BAC Level Set: ~r~' .. tostring(BACLevel)) + Notify('~r~Invalid BAC Level!') end end DropWeapon.Activated = function(ParentMenu, SelectedItem)