Maybe you could have it so that the computer AI picks a number between 1 and 20, and If it picks a number above 2, it will go and hit the ping-pong ball. If it picks 1, it will stay where it is. The computer AI will pick between 1 and 20 every time the ping-pong ball is heading towards it, or you can have it do this every time the ping-pong ball is hit. You can also make it pick between 1 and 30 to increase the difficulty, or make it 1 and 100. You get to set the difficulty wherever you like, though occasionally, you can beat the Computer AI relatively easily, even when it is picking between 1 and 909,909. You could also increase the ping-pong ball's speed to increase the difficulty.
I'm sorry that I didn't provide the script itself, but I hope that this outline of a script helps you!
Offline