Kartik Scripts

Trailer Storage

Park a truck with its trailer hitched and both go into the garage together. Take the truck out later and the trailer comes back hitched behind it.

🌟 Overview & Highlights

  • Park both at once: parking a vehicle that is towing a trailer stores the trailer with it.
  • Come back together: taking the vehicle out spawns the trailer behind it and hitches it again.
  • Shown with its vehicle: stored trailers don't clutter the garage list. They appear under the vehicle that towed them, marked with a Trailer badge.
  • Street parking too: street-parked trucks keep their trailer, parked a safe distance behind so the two can't collide.
  • Auto-registration: an unowned trailer (for example one from a job) becomes the parking player's own when they park it. Turn this off to only store trailers that are already registered.
  • Add-on trailers: add your add-on trailer spawn names to models.

🛠️ Good to Know

  • A stored trailer can't be taken out on its own. It only comes out behind the vehicle it was parked with.
  • The trailer takes up its own space in the garage. If the garage is full, the vehicle is still parked and the trailer is left hitched outside.
  • Only the owner of the towing vehicle, a sub-owner, or a member of the owning job can store the trailer.

⚙️ Configuration (shared/trailer_config.lua)

Config.Trailers = {
    enabled = true,                -- Store a hitched trailer with its vehicle and bring both back together
    autoRegister = true,           -- An unowned trailer becomes the parking player's on park (false = only registered trailers)
    checkCapacity = true,          -- The trailer takes its own space; left hitched when the garage is full
    reattachDistance = 1.0,        -- Gap in metres between the vehicle's rear and the trailer's hitch on spawn
    streetParkGap = 4.0,           -- Street parking: trailer stands this far back so it can't collide with its truck
    debug = false,                 -- Print each park/spawn step to the server console

    -- Spawn names checked when auto-registering; add your add-on trailers here.
    models = {
        'armytanker', 'armytrailer', 'armytrailer2', 'baletrailer', 'boattrailer', 'boattrailer2', 'boattrailer3',
        'docktrailer', 'freighttrailer', 'graintrailer', 'proptrailer', 'raketrailer', 'tanker', 'tanker2',
        'tr2', 'tr3', 'tr4', 'trailerlarge', 'trailerlogs', 'trailers', 'trailers2', 'trailers3', 'trailers4',
        'trailers5', 'trailersmall', 'trailersmall2', 'trflat', 'tvtrailer', 'tvtrailer2',
    },
}

On this page