# isElementAttached (Shared)

> Tells whether an element is attached to another.

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

## Syntax

```lua
bool isElementAttached(element element)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `element` | The element to check. |

## Returns

`true` if it is attached to an element that exists, `false` otherwise.

## Example

```lua
addCommandHandler("soltar", function(player)
    if isElementAttached(player) then
        detachElements(player)
    end
end)
```

## See also

- [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.
- [detachElements (Shared)](https://wiki.mymp.gg/en/detachElements.md): Detaches an element from the element it hangs on. It stays where it is.
