How to add time limitation for torque multiplier?

Hi!

I am playing with idea of having temporary boost like in all those ricer movies these days. But still can’t figure out how to pull it off

Citizen.CreateThread(function()
while true do

    Citizen.Wait(0)
	local ped = GetPlayerPed(-1)
	local playerVeh = GetVehiclePedIsIn(ped, false)

	if IsControlPressed(1, 38) then
		Citizen.Wait(0)
		SetVehicleBoostActive(playerVeh, 1, 0)
		SetVehicleEngineTorqueMultiplier(playerVeh, 1.8)

		--- "wait for 3 secs or so"----

		SetVehicleEngineTorqueMultiplier(playerVeh, 1.0)
		SetVehicleBoostActive(playerVeh, 0, 0)
		
    end
  end
end)

Does anybody have an idea how to get this to work??

I already know that for torque, there has to be citizen 0, so how could I put there delay of some sort? :slight_smile:

Any ideas, please?

20 char

So you want it to last 3 seconds?
Just put a Citizen.Wait(3000) in.

Doesn’t work. Probably because SetVehicleEngineTorqueMultiplier has to be only written with “0” to work properly. Due to that I can’t use delay like this… Or maybe correct me, but they wrote it here

https://runtime.fivem.net/doc/reference.html#_0xB59E4BD37AE292DB