M MY Multiplayer: Wiki
Side
Kind

onTrailerAttach

ServerEventCancellable

Fired on the server when a trailer is hitched to a vehicle. Cancelling the event unhitches the trailer.

addEventHandler("onTrailerAttach", root, function(vehicle towedBy) … end)

Handler parameters

NameTypeDescription
towedByvehicleThe vehicle now towing the trailer.

Source

The trailer.

Example

addEventHandler("onTrailerAttach", root, function(towedBy)
    if isVehicleLocked(source) then
        cancelEvent()
    end
end)

See also