Hey, welcome to the forums. You needn’t attach a poll to your post
Please refer to this page for how to insert code properly in the forums: Using code tags properly
Please include the error and line number reported.
If there is a line number, which there usually is. You can double-click this in the console, and it will bring you to the location in the script file. Perhaps there you can first see if you can fix the issue yourself, for example.
Pretty sure your do … while loops are going one too many times.