Vehicle-to-vehicle attachment by command

Vehicle-to-vehicle attachment script

Description:

This FiveM script allows players to attach and detach vehicles to and from other vehicles using simple chat commands and is standalone, no dependencies, which means you can use it with any framework in any server.

Commands:

  • /attach [model] - Attaches your vehicle (or a nearby vehicle) to the closest vehicle of the specified model within range. Specify [model] if you want to attach a vehicle to another vehicle. Example: /attach il76 (attaches the vehicle you are in or standing nearby of to the vehicle you want to).
  • /detach - Detaches your current or nearby attached vehicle and places you in the driver seat if nearby, if detaching from inside the vehicle, the vehicle will just be detached, nothing else.

Features:

  • Supports multiple vehicle-to-vehicle attachments at once, no limitations.
  • Fully synced with other players β€” everyone sees attached vehicles correctly.
  • Attaching works inside or outside of vehicles.
  • Supports cargo planes, ships, trailers, or any vehicle type.

By default:

  • Attach radius from inside a vehicle: 30 units.
  • Attach radius from outside a vehicle: 5 units.
  • Detach radius from outside a vehicle: 5 units.
  • Detach radius from inside a vehicle: (not required).

Usage:

  • Attaching: /attach [model] , [model] of the vehicle you want to attach to. (Example: /attach il76).
  • Detaching: /detach

Lightweight, no server-side component required. All operations are client-side and synced across players.

Example usages in-game:


Code is accessible Yes
Subscription-based No
Lines (approximately) 120
Requirements None
Support No

License:

Open Source License β€” 2025

Author: Qubbhy

This software is released under an open source license with the following terms:

Permissions:

  • Use it in both non-commercial and commercial projects.
  • Edit, modify, or build upon it in any way.
  • Include it in larger script packs or frameworks or redistribute it as modified.
  • Redistribute it, either as-is or modified.
  • Use it in private, public, or monetized FiveM servers.

There are no restrictions on how this script may be used or shared.

Attribution to the original author is appreciated but not required.

Warranty:
This software is provided β€œas-is” with no warranty or guarantee. The author assumes no responsibility for any damages or issues that may arise from its use.

9 Likes

for some reason it does not work with cargoplane why?