# getElementAttachedOffsets (Shared)

> Reads the offset, rotation and socket an element is attached with.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Attachments
- **URL**: https://wiki.mymp.gg/en/getElementAttachedOffsets

## Syntax

```lua
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

```lua
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)
```

## See also

- [setElementAttachedOffsets (Shared)](https://wiki.mymp.gg/en/setElementAttachedOffsets.md): Changes the offset, the rotation and, if asked, the socket of an attached element.
- [attachElements (Shared)](https://wiki.mymp.gg/en/attachElements.md): Hangs one element on another. From then on it follows the target until it is detached.
- [getElementAttachedTo (Shared)](https://wiki.mymp.gg/en/getElementAttachedTo.md): Tells which element an element is attached to.
