How do I make a Ground Slam Script?

How do I form a ground slam? and How can I make the code not buggy and good enough to work?