getElementBoneRotation | Multi Theft Auto: Wiki Skip to content

getElementBoneRotation

Client-side
Server-side
Shared

Manual Review Required

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


Returns the orientation of a specific bone relative to the element. Currently the Player and Ped element types are accepted.

Tip

If you want to attach an element to a bone, see attachElementToBone .

Syntax

float,​ float,​ float getElementBoneRotation ( element theElement, int boneId )
Required Arguments
  • theElement: the element to get the bone rotation on.
  • boneId: the ID of the bone to get the rotation of. See Bone IDs .

Returns

  • float: x
  • float: y
  • float: z

Returns 3 floats , representing the yaw, pitch, roll rotation values.

Code Examples

shared

This example outputs the yaw, pitch and roll orientation of a specific bone relative to the local player bone specified through a command:

function getBoneRotation (commandName, boneId)
if not tonumber (boneId) then
outputChatBox ("You didn't insert an bone ID!", 255, 0, 0)
return false
end
local x, y, z = getElementBoneRotation (localPlayer, boneId)
outputChatBox ("The bone rotation is: "..x..", "..y..", "..z)
end
addCommandHandler ("getbonerotation", getBoneRotation)

See Also

Element Functions