[C#] I need help! Set Vehicle Engine Torque Multiplier

https://runtime.fivem.net/doc/natives/#_0xB59E4BD37AE292DB
“This needs to be called every frame to take effect.”

How to make it work?
I tried using “while”, but the game freezes.
I am using MenuAPI.

I figured it out myself.

int veh = GetVehiclePedIsIn(GetPlayerPed(-1), false);
int ped = GetPlayerPed(-1);




VehiclesMenu.OnDynamicListItemSelect += (_menu, _dynamicListItem, _currentItem) =>
{
   veh = GetVehiclePedIsIn(GetPlayerPed(-1), false);
   ped = GetPlayerPed(-1);

   if (_dynamicListItem == VTMList)
      {
         if (GetPedInVehicleSeat(veh, -1) == ped)
         {
            VTMNUM = Convert.ToInt32(_currentItem);
            SetVehicleEngineTorqueMultiplier(veh, VTMNUM);
            Tick += OnTick;
            Debug.WriteLine($"TORQUE");
         };
   };
};






private async Task OnTick()
{
   if (GetPedInVehicleSeat(veh, -1) == ped)
   {
      SetVehicleEngineTorqueMultiplier(veh, VTMNUM);
      Wait(5);
   };
}

If you’re using a while loop, you’ll most likely need to put in a wait as well. Post your current code.