# getElementComponentRotation (Cliente)

> Devolve a rotação de um componente de um veículo ou objeto, em graus.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Função Lua
- **Lado**: Cliente
- **Categoria**: Componentes e ossos
- **URL**: https://wiki.mymp.gg/pt/getElementComponentRotation

## Sintaxe

```lua
float, float, float|false getElementComponentRotation(vehicle|object element, string component [, string base = "parent"])
```

## Parâmetros

| Nome | Tipo | Descrição |
| --- | --- | --- |
| `element` | `vehicle\|object` | O veículo ou objeto. |
| `component` | `string` | Nome do componente, como `getElementComponents` lista. |
| `base` | `string` | Em relação a quê: `"world"` (o mundo), `"root"` (o próprio elemento) ou `"parent"` (o frame pai do componente). Maiúsculas não importam. *(padrão: `"parent"`)* |

## Retorno

Três números `rx, ry, rz` em graus, ou `false` se o componente não existe.

## Exemplo

```lua
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
    local rx, ry, rz = getElementComponentRotation(vehicle, "door_lf_dummy")
    outputDebugString(("Porta esquerda: %.1f, %.1f, %.1f"):format(rx, ry, rz))
end
```

### Vindo do MTA

Equivale ao `getVehicleComponentRotation` do MTA, mas também funciona com objetos.

## Veja também

- [setElementComponentRotation (Cliente)](https://wiki.mymp.gg/pt/setElementComponentRotation.md): Gira um componente de um veículo ou objeto. A mudança vale só neste cliente.
- [resetElementComponentRotation (Cliente)](https://wiki.mymp.gg/pt/resetElementComponentRotation.md): Devolve um componente de um veículo ou objeto à rotação original do modelo, desfazendo setElementComponentRotation.
- [getElementComponentPosition (Cliente)](https://wiki.mymp.gg/pt/getElementComponentPosition.md): Devolve a posição de um componente de um veículo ou objeto.
