Citizen.CreateThread(function() while true do Citizen.Wait(0) local ped = GetPlayerPed(-1) if DoesEntityExist(ped) and IsPedInAnyVehicle(ped, false) and IsControlPressed(2, 75) and not IsEntityDead(ped) and not IsPauseMenuActive() then local engineWasRunning = GetIsVehicleEngineRunning(GetVehiclePedIsIn(ped, true)) Citizen.Wait(1000) if DoesEntityExist(ped) and not IsPedInAnyVehicle(ped, false) and not IsEntityDead(ped) and not IsPauseMenuActive() then local veh = GetVehiclePedIsIn(ped, true) if (engineWasRunning) then SetVehicleEngineOn(veh, true, true, true) end end end end end)