getElementAttachedOffsets
Shared
Reads the offset, rotation and socket an element is attached with.
float getElementAttachedOffsets(element element)
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The attached element. |
Returns
Seven values: the offset's x, y, z, the rotation's rx, ry, rz and the socket (the name or number used, or nil if the element follows the target's root).
It does not check whether the element is attached: it returns the values the element holds.
Example
addCommandHandler("subir", function(player)
if not isElementAttached(player) then
return
end
local x, y, z, rx, ry, rz, socket = getElementAttachedOffsets(player)
setElementAttachedOffsets(player, x, y, z + 0.5, rx, ry, rz, socket)
end)