This script provides an intuitive and user-friendly solution for towing and hauling vehicles and props. Unlike other scripts, it attaches vehicles and objects at their exact positions rather than teleporting it to a hardcoded spot. You can attach any number of vehicles/objects, the only limit is the physical space on your tow vehicle. Players can configure their towing/hauling load however they see fit and let their imagination run wild. By default, there is no limit to what vehicles or objects can be towed, allowing for maximum creativity and roleplay immersion. However, you can configure the script to limit the vehicles that can be used to tow if you wish.
Preview: https://youtu.be/oTn4ASd33R8
Some examples of what you can do with this script:
- haul multiple offroad / non street legal vehicles to your destination
- haul motorcycle(s) on the back of a pickup truck
- haul boats on a trailer
- haul multiple vehicles using the car carrier trailer (tr2)
- haul cargo on a trailer (crates, pallets, etc)
- create a mobile farmers market on the back of a pickup truck
- create a mobile firework show on a party bus (with wp-fireworks)
- create immersive jobs where players can haul vehicles or props to a destination
The scenarios that can be created with this script are limited only by your imagination.
Best paired with a script that can be used for placing props in the world such as Waypoint Placeables.
Towing
- Enter tow selection mode by using the command
/tow
or by using the eventwp-hauling:client:startTowSelection
- Look at and select the vehicle you will be towing to
- Look at and select the vehicle/object you want to tow/haul
- Confirm or cancel the selection
- If confirmed, the vehicle/object will be attached to the tow vehicle at its exact position
Repeat steps 1-5 as many times as you like to attach more vehicles/objects.
Untowing
- Enter untow selection mode by using the command
/untow
or by using the eventwp-hauling:client:startUntowSelection
- Look at and select the vehicle/object you want to untow
- Vehicle/object will be unattached and remain in the same position
- Enable the script in your server.cfg
- Configure the script in the config.lua
- Choose the notification framework you are using with
Config.Notify
. - Choose the keybinds you want to use for selecting and canceling select mode:
Config.ConfirmVehicleSelectionKey
/Config.ExitVehicleSelectionKey
- Decide whether you want to limit the vehicles that can be used to tow with
Config.AllowAllVehiclesToTow
andConfig.AllowedTowVehicles
.- Recommendation: For the best experience and enabling fullest potential of creativity, I do NOT recommend limiting the allowed vehicles.
- Decide whether you want to allow attaching props with
Config.AllowHaulingProps
.
- Choose the notification framework you are using with
- By default, the commands
/tow
and/untow
are used to start the actions. You can use the provided events to hook these up in your own way (ex: Radial menu).wp-hauling:client:startTowSelection
andwp-hauling:client:startUntowSelection
Note: If you are using
ox
for any of the Framework options you need to uncomment@ox_lib/init.lua
in the fxmanifest.lua.
For the best experience, it is recommended to have a script for placing/carrying/moving props in the world. Waypoint Placeables is a great option for this and also provides ramp items that can be used to easily load vehicles onto trailers.
This script is designed to be immersive and attach vehicles in place. As such it does not teleport vehicles onto your tow vehicle. To be able to tow broken down cars, it is recommended to have a script for pushing broken down cars. You can then place a ramp, and push the vehicle up the ramp onto your tow trailer.
This script was written with performance in mind. The only time the resource will run higher than 0.00ms is while in tow/untow select mode when we are running the raycast thread. Otherwise there are no other threads or loops running.
Idle: 0.00ms With vehicles attached: 0.00ms Attachment mode active: 0.02ms - 0.08ms (drawing markers + using raycast to detect selection) - After selection is confirmed resource returns to 0.00ms
This resource was designed to be standalone and does not require any other resources to function.
If you want to use notifications, there is a built in framework wrapper around the Notify()
function to hook into the notifications framework of your choice.
@DonHulieo for providing insipiration and examples for structuring the framework.lua file.