setVehicleRotorSpeed | Multi Theft Auto: Wiki Skip to content

setVehicleRotorSpeed

Client-side
Server-side
Shared

Pair: getVehicleRotorSpeed

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


Sets the rotor speed of a helicopter or plane. This function now applies to both helicopters and planes.

Note

Setting higher values will cause problems to the client

OOP Syntax Help! I don't understand this!

  • Method:vehicle:setVehicleRotorSpeed(...)
  • Variable: .vehicleRotorSpeed

Syntax

bool setVehicleRotorSpeed ( vehicle theVehicle, float speed )
Required Arguments
  • theVehicle: the vehicle (helicopter or plane) to adjust the rotor of.
  • speed: the new rotor speed. Usual values are 0 if the vehicle is stationary, or 0.2 if the rotor is fully spun up. Higher values than normal will not affect the vehicle's handling. Negative values are allowed and will make the rotor spin in the opposite direction (for helicopters, this pushes it down).

Returns

  • bool: value

Returns true if successful, false otherwise.

Code Examples

shared
addCommandHandler("rs", function()
local theVehicle = getPedOccupiedVehicle(localPlayer)
if not theVehicle then return end
local controller = getVehicleController(theVehicle)
if controller ~= localPlayer then return end
local vehicleType = getVehicleType(theVehicle)
if vehicleType ~= "Helicopter" and vehicleType ~= "Plane" then return end
setVehicleRotorSpeed(theVehicle, 10)
end)

See Also

Vehicle Functions