How can I get the output of scripts, not just errors, but also if print() is being called, the output of that. The code I have right now only checks for errors.
game:GetService("ScriptContext").Error:connect(function(msg,stack,source) if source == script then msg = string.gsub(msg,"Workspace.loadcode.Compiler","LuaVM") msg = string.gsub(msg,"@compiled-lua","@loadstring") msg = string.gsub(msg,"compiled-lua","@loadstring") local message = msg log("bad",message) game:GetService("ReplicatedStorage").PostDiscord:InvokeServer(message,"error",false) end end)