The only solution i’ve found is to use something that refreshes the player’s PED, for example a script that with a press of a button does this:
ClearPedTasksImmediately(GetPlayerPed(-1))
An example on the whole script, (client side)
local isDead = false
AddEventHandler('esx:onPlayerDeath', function(data)
isDead = true
end)
AddEventHandler('playerSpawned', function(spawn)
isDead = false
end)
Citizen.CreateThread(function()
while true do
Wait(0)
if IsControlPressed(0, Keys['F9']) and isDead then
ClearPedTasksImmediately(GetPlayerPed(-1))
CurrentAction = nil
end
end
end)