First, you need to make a model, using a modeling program, such as Blender. Then, you need to learn to script. I'm told it's more of a self-taught process than anything, and involves experimenting with preexisting scripts until you figure out what certain things do.
Also, SEARCH. There have been millions of topics about the same exact thing.