- Documentation
- Client functions
- getPedBoneCount
Function
getPedBoneCount
Returns the number of skeleton bones a ped has in this version of the game (the Definitive Edition skeleton has more than the classic one). Returns 0 when the game has not shown any ped yet. Together with getPedBoneName it lets you list every bone.
Syntax
int getPedBoneCount()Returns
Number of bones (0 when the skeleton is not known yet).
Example
for i = 0, getPedBoneCount() - 1 do
outputConsole(i .. ": " .. tostring(getPedBoneName(i)))
end
See also
getPedBoneNameReturns the name of the game skeleton bone with the given index (e.g."Head","R_Hand"). The index is the bone's position in the Definitive Edition skeleton (0 togetPedBoneCount() - 1), not a number fromgetBoneIDs.getPedBoneIndexByNameConverts a game skeleton bone name to its index, which you can then pass togetPedBonePositionand similar functions. Some names repeat in the skeleton (there are e.g. two "Spine" bones); the second argument picks which occurrence to return.