# setElementComponentRotation (Client)

> Turns a vehicle's or object's component. The change applies on this client only.

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

## Syntax

```lua
bool setElementComponentRotation(vehicle|object element, string component, float rx, ry, rz [, string base = "parent"])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `vehicle\|object` | The vehicle or object. |
| `component` | `string` | The component's name, as `getElementComponents` lists it. |
| `rx, ry, rz` | `float` | The new rotation in degrees, as three numbers or one `vec3`. |
| `base` | `string` | Relative to what: `"world"`, `"root"` (the element itself) or `"parent"` (the component's parent frame). Case does not matter. *(default: `"parent"`)* |

## Returns

`true`.

The rotation is kept while the element exists, and comes back when it streams in again.

## Example

```lua
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
    setElementComponentRotation(vehicle, "wheel_lf_dummy", 0, 0, 30)
end
```

### Coming from MTA

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

### Note

Returns `true` even when the component does not exist. Check the name with `getElementComponents`.

## See also

- [getElementComponentRotation (Client)](https://wiki.mymp.gg/en/getElementComponentRotation.md): Returns the rotation of a vehicle's or object's component, in degrees.
- [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.
- [setElementComponentPosition (Client)](https://wiki.mymp.gg/en/setElementComponentPosition.md): Moves a vehicle's or object's component. The change applies on this client only.
