[HELP]Spawn truck with a trailer

I am creating a script and I need to create a function or something similar to make appear a truck and a trailer and that this appears stuck to the truck, can anyone help me?