Glitched Scripts
Advanced Trailers

Trailer setup

Use /traileroffset to place static load markers and bed slots.

/traileroffset is an in-world editor for static.load and static.bed on the nearest trailer. It prints a static block to F8 and copies it to the clipboard when lib.setClipboard exists. Paste that into the trailer entry in Config.Trailers.

Place a ghost vehicle with a free camera, then copy the static block.

Start

Stand next to a spawned trailer (within 15m).

/traileroffset              -- ghost uses sultan
/traileroffset comet2       -- ghost uses that spawn name

The editor stays open until you finish or cancel. Your ped is hidden and frozen while it runs.

Phases

  1. Load. Move the ghost to the walk-up load / unload point (where the static helper marker should sit). Press Enter or left click to confirm.
  2. Bed. Place one ghost per slot. Enter or left click confirms a slot and spawns the next ghost. Repeat until the deck is full.
  3. Finish. Press F to print and copy. A ghost you have not confirmed yet is discarded.

Backspace undoes the last confirmed bed. Escape (or Backspace when there is nothing to undo) cancels without copying.

Controls

Place mode (default):

InputAction
WASDMove (relative to the trailer)
Q / EDown / up
Arrow keysRotate
ShiftFaster
CtrlFiner
Enter / left clickConfirm the load point, then each bed
FFinish and copy the static block
BackspaceUndo the last bed, or cancel
EscapeCancel
XToggle free camera

Free camera (X):

InputAction
WASDFly the camera
Q / EDown / up
ShiftFaster
Mouse wheelZoom
XLock (back to place mode)
EscapeCancel

A TextUI readout shows the current phase and the offset / rotation.

Output

Paste the clipboard block into the trailer entry:

[`trflat`] = {
    isBoat = false,
    onAttachedExtras = {},
    ramp = false,
    static = {
        load = {offset = vec3(0.0, -11.456, -0.577), rotation = vec3(0.0, 0.0, 0.0)},
        bed = {
            {offset = vec3(-0.009, 2.907, 0.853), rotation = vec3(0.0, 0.0, 0.0)},
            {offset = vec3(-0.017, -2.340, 0.853), rotation = vec3(0.0, 0.0, 0.0)},
        }
    },
},

load is the helper marker and the walk-up attach point. bed is each lock-in slot. Capacity is the number of bed entries. Boat trailers use isBoat plus an optional offset vec3 instead of static. See Using trailers and shared/config.lua.

On this page