# getElementComponents (Client)

> Lists a vehicle's or object's components: the named frames of its model.

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

## Syntax

```lua
table|false getElementComponents(vehicle|object element)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `vehicle\|object` | The vehicle or object. |

## Returns

A table with each component's name as the key and `true` or `false` for whether it is visible, or `false` if the model has no components.

## Example

```lua
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
    for name, visible in pairs(getElementComponents(vehicle)) do
        outputDebugString(name .. ": " .. tostring(visible))
    end
end
```

### Coming from MTA

The same as MTA's `getVehicleComponents`, but it also works on objects whose model has frames.

## See also

- [getElementComponentVisible (Client)](https://wiki.mymp.gg/en/getElementComponentVisible.md): Tells whether a vehicle's or object's component is visible.
- [setElementComponentVisible (Client)](https://wiki.mymp.gg/en/setElementComponentVisible.md): Shows or hides a vehicle's or object's component. The change applies on this client only.
- [getElementComponentPosition (Client)](https://wiki.mymp.gg/en/getElementComponentPosition.md): Returns the position of a vehicle's or object's component.
