# setElementComponentVisible (Client)

> Shows or hides 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/setElementComponentVisible

## Syntax

```lua
bool setElementComponentVisible(vehicle|object element, string component, bool visible)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `vehicle\|object` | The vehicle or object. |
| `component` | `string` | The component's name, as `getElementComponents` lists it. |
| `visible` | `bool` | `true` to show it, `false` to hide it. |

## Returns

`true` if it was changed, `false` if the component does not exist.

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

## Example

```lua
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
    setElementComponentVisible(vehicle, "bonnet_dummy", false)
end
```

### Coming from MTA

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

## See also

- [getElementComponentVisible (Client)](https://wiki.mymp.gg/en/getElementComponentVisible.md): Tells whether a vehicle's or object's component is visible.
- [getElementComponents (Client)](https://wiki.mymp.gg/en/getElementComponents.md): Lists a vehicle's or object's components: the named frames of its model.
