# isElementAttached (Compartilhado)

> Diz se um elemento está anexado a outro.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Função Lua
- **Lado**: Compartilhado
- **Categoria**: Anexos
- **URL**: https://wiki.mymp.gg/pt/isElementAttached

## Sintaxe

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

## Parâmetros

| Nome | Tipo | Descrição |
| --- | --- | --- |
| `element` | `element` | O elemento a consultar. |

## Retorno

`true` se está anexado a um elemento que existe, `false` caso contrário.

## Exemplo

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

## Veja também

- [attachElements (Compartilhado)](https://wiki.mymp.gg/pt/attachElements.md): Pendura um elemento em outro. A partir daí ele segue o alvo até ser solto.
- [getElementAttachedTo (Compartilhado)](https://wiki.mymp.gg/pt/getElementAttachedTo.md): Diz em qual elemento um elemento está anexado.
- [detachElements (Compartilhado)](https://wiki.mymp.gg/pt/detachElements.md): Solta um elemento do elemento em que está anexado. Ele fica onde está.
