From 9f7ca3f3b94623a4a62f1eb9d72e0ce5b493d035 Mon Sep 17 00:00:00 2001 From: Kasey FItton Date: Mon, 11 Nov 2024 20:55:49 +0000 Subject: [PATCH] fix: Cached Ped Not updating correctly --- [core]/es_extended/client/modules/actions.lua | 12 +++++++++++- [core]/skinchanger/client/main.lua | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/[core]/es_extended/client/modules/actions.lua b/[core]/es_extended/client/modules/actions.lua index 455dcff0..89d3c0ba 100644 --- a/[core]/es_extended/client/modules/actions.lua +++ b/[core]/es_extended/client/modules/actions.lua @@ -136,7 +136,6 @@ end function Actions:SlowLoop() CreateThread(function() while ESX.PlayerLoaded do - self:TrackPed() self:TrackPedCoords() self:TrackPauseMenu() self:TrackVehicle() @@ -145,8 +144,19 @@ function Actions:SlowLoop() end) end +function Actions:PedLoop() + CreateThread(function() + while ESX.PlayerLoaded do + self:TrackPed() + Wait(0) + end + end) +end + + function Actions:Init() self:SlowLoop() + self:PedLoop() 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)