So lets say i have 200 lines of code which i do i put it in a script so it can repeat when i do so it breaks is there a more organized way to loop games. Look at stickmasterluke’s game Survive The Natural Disaster For Instance It Is Looped In A Way I Want To Replicate That
What is this while true do loop nightmare? Anyways, I think you forgot to add some yielding. Without yielding, the code will be exhausted from high rate of looping.
wait() is the yielding.
I doubt you need to loop the entire thing all the time.
Ugh, just forward the entire 200 lines of code with the loop. I believe I can make this more effective. Mind if you PM me if you believe this will drag on for too long?
Make sure to add waits where appropriate. The game script is timing out because each iteration of your while loop is running too quickly. This is done to prevent Studio crashing, which was once a problem when while loops weren’t being properly handled in the past.
I checked the entire code and gave them the fixed solution. The loop is extremely useless and from what I know of the code there, was poor understanding of coding logic.
The loop was very expensive to maintain and some of the code were malformed from intended functionality. Especially that it kept attaching new connections to a listener.