How can I properly attach a character to a vehicle?

That code works now I tested it in 4.12