From a3fab28d1f08a7375060748b08e3473e9a3bc592 Mon Sep 17 00:00:00 2001 From: Kasey FItton Date: Mon, 11 Nov 2024 20:36:00 +0000 Subject: [PATCH] fix: Cached Ped not being updated Correctly --- [core]/es_extended/client/modules/actions.lua | 10 ++++++++++ [core]/skinchanger/client/main.lua | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[core]/es_extended/client/modules/actions.lua b/[core]/es_extended/client/modules/actions.lua index 455dcff0..1f495682 100644 --- a/[core]/es_extended/client/modules/actions.lua +++ b/[core]/es_extended/client/modules/actions.lua @@ -145,8 +145,18 @@ function Actions:SlowLoop() end) end +function Actions:PedTrackingLoop() + CreateThread(function() + while ESX.PlayerLoaded do + self:TrackPed() + Wait(0) + end + end) +end + function Actions:Init() self:SlowLoop() + self:PedTrackingLoop() end Actions:Init() diff --git a/[core]/skinchanger/client/main.lua b/[core]/skinchanger/client/main.lua index e28aee17..76d5d4f2 100644 --- a/[core]/skinchanger/client/main.lua +++ b/[core]/skinchanger/client/main.lua @@ -44,7 +44,7 @@ function SkinChanger:DefaultModel(male, cb) local model = self:RequestModel(characterModel) SetPlayerModel(PlayerId(), model) - SetPedDefaultComponentVariation(playerPed) + SetPedDefaultComponentVariation(PlayerPedId()) SetModelAsNoLongerNeeded(model)