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

Function

getPedBoneIndexByName

ClientPedsTrilogy Hub only

Converts a game skeleton bone name to its index, which you can then pass to getPedBonePosition and similar functions. Some names repeat in the skeleton (there are e.g. two "Spine" bones); the second argument picks which occurrence to return.

Syntax

int getPedBoneIndexByName(string name [, int occurrence = 0])

Arguments

namestring
Bone name, e.g. "Head".
occurrenceint, optional = 0
Which occurrence of a repeated name: 0 = first, 1 = second, and so on.

Returns

The bone index, or false/nil when there is no such name.

Example

local head = getPedBoneIndexByName("Head")
local x, y, z = getPedBonePosition(localPlayer, head)

See also