If, in some bizarre case, you have a looping round script and it breaks, your entire game is on freeze. Forever! In that case, could you possibly wrap said round script in a giant pcall
as follows?
function mainRoundSequence() while wait() do -- intermission wait(10) -- load map wait(5) -- load characters wait(30) -- round over wait(5) -- articulate the round stats, start over. end end while wait(1) do success, err = pcall(function() mainRoundSequence() end) if err then print(err) end end
Again, would this script theoretically work to make your script "break-proof"? Thanks in advance.
While you could, you do not need to do this, and this does not make your scripts 100% break proof. pcall only catches runtime errors, so if you have syntax errors do not expect pcall to stop those. Syntax errors are what prevent your code from compiling in the first place. You should only wrap the bits that cause you problems in a pcall, and then fix them once you realise the error. And please do not call wait
in your loop's condition.