If I have a while wait() do script while there is a bunch of other script, will all the other scripts be paused or no?
Does while wait() do stop all other code in a script?
1 answer
Technically, yes, however. I suggest now using a while wait() do for a game. For one, it is unstable and runs at a second radius, using up server data, and as I said it does stop everything in the script below it.
However, I would like to suggest something, given you are only having checks, if statements and conditions, I would suggest not using a while wait() do loop, while it prevents a crash, it is still not good practice. I suggest using
RunService.Heartbeat
Heartbeat runs based on every frame in the RunService, typically around 1/60th of a second and it will check that many times per second, so every frame basically. This is far more stable and reliable than having while wait() do in your code in my honest opinion with a, "infinite check," that the server needs to infinitely see, I find myself personally using it for stuff like magnitude from one part to another. But trust me, it has it's uses, give it a try.
1 comment
I never understood how to use this. Is it RunService.Heartbeat:Connect(function() ... end) ?
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Depends. It will stop any code after it. Because computers run based on lines of codes and as such it would read the first lines of code before. So If the code is at the very beginning it will stop all other code in the script
Why are you using this idiom anyways