getElementAngularVelocity | Multi Theft Auto: Wiki Skip to content

getElementAngularVelocity

Client-side
Server-side
Shared

Pair: setElementAngularVelocity

Gets the current angular velocity of a specified element. This can be a player, ped, object, vehicle or weapon.

Note

Server side supports only vehicle type currently.

OOP Syntax Help! I don't understand this!

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

Syntax

float|false, ​float, ​float getElementAngularVelocity ( ​element theElement )
Required Arguments
  • theElement: The element to retrieve the angular velocity from.

Returns

  • float|false: x
  • float: y
  • float: z

Returns three floats describing the x, y and z rotation or false if invalid element was passed.

Code Examples

client
addCommandHandler("getangularvelocity", function(commandName)
local aX, aY, aZ = getElementAngularVelocity(localPlayer)
outputChatBox("Your current angular velocity is: X: " .. aX .. " Y: " .. aY .. " Z: " ..aZ)
end)

See Also

Element Functions