setElementBonePosition | Multi Theft Auto: Wiki Skip to content

setElementBonePosition

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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


This function sets the position of a bone to the specified coordinates. Currently the Player and Ped element types are accepted.

Note

You need to use this function together with onClientPedsProcessed .

Tip

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

Syntax

setElementBonePosition ( )

Code Examples

client

This example shows a surprised CJ with a long neck

local bones = {
[4] = Vector3(0, 0, 0.15),
[5] = Vector3(0, 0, 0.15),
[6] = Vector3(0, 0, 0.13),
[7] = Vector3(0, 0, 0.13),
[8] = Vector3(0, 0, 0.1),
}
function updatePed()
for bone,v in pairs(bones) do
local pos = localPlayer:getBonePosition(bone)+v
setElementBonePosition(localPlayer, bone, pos)
end
end
addEventHandler("onClientPedsProcessed", root, updatePed)

See Also

Element Functions