Page cover

πŸš›Trailers

Easily add trailers than can be used to attach vehicles to in Config.Trailers

  • Trailers are NOT spawned via this script, it just adds the logic to them allowing vehicles to be attached. You must ensure you have your own methods of spawning trailers

  • The key is the trailer spawn name


  • The key is the spawn name of the trailer you wish to add the attachment logic to

  • The trailer must be in your vehicles.lua

['my_custom_trailer_name'] = { -- the key is the trailer name
    ---
},

  • Define the prop model used for the ramp

  • The offset must be a vec3 value

['my_custom_trailer_name'] = { -- the key is the trailer name
    ramp = { -- define ramp settings
        model = 'xs_prop_x18_flatbed_ramp', -- ramp model
        offSet = vec(0.0, -8.30, -1.8), -- ramp offset
        rotation = 180.0, -- ramp rotation
    },
    ---
},

  • Define black listed vehicles that can not be attached by defining their spawn name in the black listed table

  • These must be in your vehicles.lua

['my_custom_trailer_name'] = { -- the key is the trailer name
    ---
    blacklisted = { -- define vehicles that are black listed from being attached
        'adder',
        --add more as required
    }, 
},

  • Below is an example of a finished config entry for a custom trailer with a black listed vehicle

['my_custom_trailer_name'] = { -- the key is the trailer name
    ramp = { -- define ramp settings
        model = 'xs_prop_x18_flatbed_ramp', -- ramp model
        offSet = vec(0.0, -8.30, -1.8), -- ramp offset
        rotation = 180.0, -- ramp rotation
    },
    blacklisted = { -- define vehicles that are black listed from being attached
        'adder',
        --add more as required
    }, 
},

Last updated