setElementAngularVelocity | Multi Theft Auto: Wiki Skip to content

setElementAngularVelocity

Client-side
Server-side
Shared

Pair: getElementAngularVelocity

Sets the angular velocity of a specified, supported element (Applies a spin to it).

Note

Server side supports only vehicle type currently.

OOP Syntax Help! I don't understand this!

  • Method:element:setAngularVelocity(...)
  • Variable: .angularVelocity

Syntax

bool setElementAngularVelocity ( ​element theElement, ​float rx, ​float ry, ​float rz )
Required Arguments
  • theElement: The element to apply the spin to. Can be either a player, ped, object, vehicle or weapon.
  • rx: Velocity around the X axis.
  • ry: Velocity around the Y axis.
  • rz: Velocity around the Z axis.

Returns

  • bool: result

Returns true if it was succesful, false otherwise.

Code Examples

server
function onColShapeHit(thePlayer, matchingDimension)
local vehicle = getPedOccupiedVehicle(thePlayer)
if (not vehicle) then return end
setElementAngularVelocity(vehicle, 0, 0, 20)
end
addEventHandler("onColShapeHit", root, onColShapeHit)

See Also

Element Functions