Glitched Scripts
Advanced Flatbeds

Exports

Client exports for gs-flatbeds.

All exports are client. There are no server exports. Pass a truck entity handle. Most calls also go through CanUseFlatbed / CanAttachVehicle.

Bed and cargo

exports['gs-flatbeds']:ToggleAttach(truck)
-- attach nearby cargo, or detach if something is already on the bed

exports['gs-flatbeds']:RequestBedMove(truck, dir)
-- dir: 1 lower, -1 raise, 0 stop. Rolling beds only.

exports['gs-flatbeds']:ToggleWheelLift(truck)
-- open / close wheelDoor on models that set it

exports['gs-flatbeds']:WarpIntoCargo(truck)
-- warp into cargo if HasOwnership and the vehicle is unlocked

local cargo = exports['gs-flatbeds']:GetCargoOnBed(truck)
-- entity handle, or 0

local isBed = exports['gs-flatbeds']:IsFlatbed(veh)
-- true if the model is in Config.Vehicles

Winch

Winch exports no-op on static beds and when Config.WinchEnabled is false.

exports['gs-flatbeds']:WindWinch(truck)           -- connect if idle, else wind (toggles off if already winding)
exports['gs-flatbeds']:WindWinch(truck, target)  -- optional cargo entity to connect
exports['gs-flatbeds']:UnwindWinch(truck)
exports['gs-flatbeds']:DeleteWinch(truck)        -- clear cable state
exports['gs-flatbeds']:GrabWinch(truck)          -- pick the cable up by hand

local ok = exports['gs-flatbeds']:ConnectWinchToVehicle(truck, cargo, cargoBone, skipAnim)
-- cargoBone optional (default chassis). skipAnim true skips the attach clip.

Use these from another resource (radial menu, job script) instead of duplicating keybinds. Player-facing flow: Using flatbeds.

On this page