Without the while loop, it works but I need to stop the loop so I added the While Loop and it does not work.
The wait function appears to causing some issues because when I remove it, the while loop works but its too fast.
Develop games in your browser. Powerful, performant & highly capable.