# getElementComponentRotation (Client)

> Returns the rotation of a vehicle's or object's component, in degrees.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Components and bones
- **URL**: https://wiki.mymp.gg/en/getElementComponentRotation

## Syntax

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

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `vehicle\|object` | The vehicle or object. |
| `component` | `string` | The component's name, as `getElementComponents` lists it. |
| `base` | `string` | Relative to what: `"world"`, `"root"` (the element itself) or `"parent"` (the component's parent frame). Case does not matter. *(default: `"parent"`)* |

## Returns

Three numbers `rx, ry, rz` in degrees, or `false` if the component does not exist.

## Example

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

### Coming from MTA

The same as MTA's `getVehicleComponentRotation`, but it also works on objects.

## See also

- [setElementComponentRotation (Client)](https://wiki.mymp.gg/en/setElementComponentRotation.md): Turns a vehicle's or object's component. The change applies on this client only.
- [resetElementComponentRotation (Client)](https://wiki.mymp.gg/en/resetElementComponentRotation.md): Puts a vehicle's or object's component back at the model's own rotation, undoing setElementComponentRotation.
- [getElementComponentPosition (Client)](https://wiki.mymp.gg/en/getElementComponentPosition.md): Returns the position of a vehicle's or object's component.
