Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I stop roblox from interrupting on errors?

I accidentally enabled the property that stops a game and brings you to the bad piece of code on an error. How do I disable this property so the game will continue running (although the bad script terminated on error)?

1 comment

0

You can't disable or enable stopping scripts when there is an error, although you can use pcall()

2 answers

✓ Accepted answer

In the Ribbon, while a script/localscript is open, navigate to Script Menu.

The section titled Debug Errors can be switched to Never to not start the debugger when there is an error.

Using pcall() would fix it

Example:

local success, problem = pcall(function()
	code here
end)

if success then
	print('The function worked!')
else
	-- something went wrong
	print(problem)
end

This method allows you to call functions without breaking the script. It tells you if it failed or succeeded.

Please accept my answer :)

This discussion is preserved as it was. New answers, comments, and votes are closed.