- Documentation
- Shared functions
- isElementAttachedToBone
Function
isElementAttachedToBone
Checks whether an element is attached to a ped's bone.
Syntax
bool isElementAttachedToBone(element theElement)Arguments
theElementelement- The element.
Returns
true if attached to a bone.
Example
if isElementAttachedToBone(hat) then
detachElementFromBone(hat)
end
See also
attachElementToBoneAttaches an element (e.g. an object) to a ped's bone, with an offset and rotation. The element moves with the bone, e.g. a hat with the head or a weapon in a hand. Bone numbers are the same as ingetBoneIDs(e.g. 1 pelvis, 8 head, 25 right hand, 35 left hand).detachElementFromBoneDetaches an element attached to a bone withattachElementToBone. The element goes back to its own position (the one fromsetElementPosition), so if it should stay where the hand was, set its position before detaching.