Script timeout exhausted allowed execution time

Can you provide the full script, full error message in console (it includes line number), that’d be useful, thanks.

The full script has 1034 lines of code :sweat_smile:

I added it, but still don’t work, should i add it to every loops?

Then when you play the game please open console and show the errors with the line numbers at which they occur at, then provide those lines of code.


image
line 291 is wait(0.5)

Yeah, you likely have too many “wait()” commands in this one function, I’d work on removing the ones that you can, and for the ones which are necessary, reduce the amount of time they yield for.

You can also increase the script timeout length in settings:

image

I’d suggest attempting to fix the issue with the previous solution first however.

Type this into Search. I brings up too many for me to read…

“timeout exhausted allowed execution time’”

And put a Print statement every other line, and follow the flow…

Always Check Your Assumptions. One or more is wrong.

And you are going to have to get a debounce in there, else you have no idea how many Connections it is creating…

Between 10 and 30 connections per map