From 0189d284495490c9ea384d6bd38ca122a904ba6e Mon Sep 17 00:00:00 2001 From: Tony <97451137+TonybynMp4@users.noreply.github.com> Date: Sat, 7 Oct 2023 22:30:39 +0200 Subject: [PATCH] Update main.lua --- client/main.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 03ec3f1..d808d5b 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,4 +1,4 @@ -local onDuty = QBX.PlayerData.job.onduty +local onDuty = QBX?.PlayerData?.job?.onduty RegisterNetEvent('QBCore:Client:SetDuty', function(duty) onDuty = duty @@ -338,4 +338,8 @@ CreateThread(function() } } }) -end) \ No newline at end of file +end) + +AddEventHandler('QBCore:Client:OnPlayerLoaded', function() + onDuty = QBX?.PlayerData?.job?.onduty +end)