Glitched Scripts
Advanced Flatbeds

Flatbed setup

Use /flatbedsetup to place control, cargo, load, and winch offsets.

/flatbedsetup is an in-world editor for a Config.Vehicles row on the nearest truck. It prints a Lua block to F8 and copies it to the clipboard when lib.setClipboard exists. Paste that into Config.Vehicles.

Place the control point, select the bed bone (optional), vehicle attach offset, load zone, and select the winch bone (optional) and winch detect distance.

If your truck is not in the bundled list, use this command to add it, or contact me and I will be happy to configure it for you.

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

Start

Stand next to a spawned truck (within 15m). The command uses the closest vehicle in that range, configured or not.

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

The editor stays open until you finish or cancel. Your ped is hidden and frozen while it runs. Bed type starts from the existing Config.Vehicles entry, or rolling if the model is new.

Press G to cycle bed type: rollingstatictrailer. Phases that do not apply to the current type are skipped.

Phases

Order depends on bed type:

  1. Control. Place the interact point (where the world UI sits). Enter or left click confirms.
  2. Bed bone (rolling / trailer). Cycle bones with left / right arrows. Confirm the moving ramp bone.
  3. Cargo (rolling / static). Move and rotate the ghost to the on-bed snap pose.
  4. Load (rolling / static). Place the static load / unload zone (dropOffset on static beds).
  5. Winch bone (rolling / trailer). Cycle bones, then confirm the cable origin.
  6. Winch. Place the hook-check distance behind the truck (hookBack). Confirm finishes.

R on control or bed-bone skips ahead as a static bed (control, then cargo). F finishes early and copies whatever you have placed.

Backspace undoes the last confirmed step. Escape cancels without copying.

Controls

Place mode (default):

InputAction
WASDMove (relative to the truck)
Q / EDown / up
Arrow keysRotate (cargo) or cycle bones (bed / winch bone)
ShiftFaster
CtrlFiner
GCycle bed type
Enter / left clickConfirm the current phase
RSkip to static (control / bed bone only)
FFinish and copy the vehicle block
BackspaceUndo the last step, 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, bed type, and the offset / bone name.

Output

Paste the clipboard block into Config.Vehicles:

[`flatbedm2`] = {
    bed = 'rolling',
    rampBone = 'misc_a',
    unwindLimit = 10.0,
    interact = vector3(-1.800, -4.500, -0.550),
    cargoOffset = vector3(0.000, 1.200, -0.100),
    cableBone = 'misc_b',
    hookRadius = 5.000,
    hookBack = 10.000,
    rampRaised = 0.03,
    rampLowered = 0.26,
},

interact is the world UI. cargoOffset is the on-bed snap. dropOffset is the static load zone. rampBone / cableBone are entity bones. Rolling rows also get placeholder rampRaised / rampLowered values you can tune in-game.

Field matrix and extras (wheelDoor, roofAnim, attachLift): shared/config.lua. Player flow: Using flatbeds.

On this page