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

Is there a way to check if a script failed using another script, and if so, what the errors were?

I know this is specific and weird, but the title pretty much what I want to know. Thank you.

1 answer

✓ Accepted answer

It's possible using ScriptContext.Error, which passes the error message, traceback, and the script that errored

game:GetService("ScriptContext").Error:Connect(function(message, trace, erroredScript)
	print(erroredScript.Name .. " has errored!")
	print("Error message: " .. message)
	print("Trace: " .. trace)
end)

Note that will only fire when a script errors. If you want an event that fires with warnings or prints, you could also use LogService.MessageOut (however it doesn't send which script sent the message)

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