Feel free to use. If the ball gets stuck going right drag it to the left wall and bounce it off. That should fix it.
This is an improved (hopefully) script for Tesla_coil123's script.