When I execte the script the bug happens, really mean that. The code came from workshop 5 in the files you download off of the 3dgamstudio website. Where the manual download is located. I added a few things to the code if you have noticed.