# onClientTrailerAttach (Cliente)

> Disparado no cliente quando um reboque é engatado num veículo.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Evento Lua
- **Lado**: Cliente
- **Categoria**: Veículos
- **URL**: https://wiki.mymp.gg/pt/onClientTrailerAttach

## Sintaxe

```lua
addEventHandler("onClientTrailerAttach", root, function(vehicle towedBy) ... end)
```

## Parâmetros do handler

| Nome | Tipo | Descrição |
| --- | --- | --- |
| `towedBy` | `vehicle` | O veículo que passou a puxar o reboque. |

## Source

O reboque.

## Exemplo

```lua
addEventHandler("onClientTrailerAttach", root, function(towedBy)
    if getPedOccupiedVehicle(localPlayer) == towedBy then
        outputDebugString("Reboque engatado")
    end
end)
```

## Veja também

- [onClientTrailerDetach (Cliente)](https://wiki.mymp.gg/pt/onClientTrailerDetach.md): Disparado no cliente quando um reboque é solto do veículo que o puxava.
- [onTrailerAttach (Servidor)](https://wiki.mymp.gg/pt/onTrailerAttach.md): Disparado no servidor quando um reboque é engatado num veículo. Cancelar o evento solta o reboque.
- [getVehicleTowedByVehicle (Compartilhado)](https://wiki.mymp.gg/pt/getVehicleTowedByVehicle.md): Devolve o reboque ou veículo que este veículo está puxando.
- [getVehicleTowingVehicle (Compartilhado)](https://wiki.mymp.gg/pt/getVehicleTowingVehicle.md): Devolve o veículo que está puxando este veículo.
