Switch and train contists

Hello. Does anyone know how to script switches and train contists?

Umm… I do but why do require this?