Reuse your script with version 6.0.0.6 ; it work fine with;simply add this line code to your action ball (or inside main) to prevent some weird behaviour of the ball:

ph_setcorrections(60000,0.01);

Hope that help.