ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. getPedBoneRotation

Function

getPedBoneRotation

ClientPedsTrilogy Hub only

Returns the world rotation of a chosen skeleton bone of a ped, in degrees, exactly as it looks in the current animation frame. Works for peds visible in this game. Useful for attaching objects to a hand or the head so they rotate with it.

Syntax

float, float, float getPedBoneRotation(ped ped, int bone)

Arguments

pedped
A player or an NPC.
boneint
Bone number (as in getBoneIDs) or a game bone index (as in getPedBonePosition).

Returns

Rotation rx, ry, rz in degrees (rz: 0 = north), or false.

Example

local rx, ry, rz = getPedBoneRotation(localPlayer, 6)

See also