[Edited]
local scriptService = game:GetService("ScriptContext")
local ds = game:GetService("DataStoreService")
local errorLogs = ds:GetOrderedDataStore("ErrorLogs")
local function errorDetected(message,trace,brokenScript)
print("Error detected: "..tostring(message))
local key = tostring(math.floor(os.time()))
pcall(function() errorLogs:UpdateAsync(key, function() return {Script = brokenScript:GetFullName(),Error = message,Trace = trace} end) end)
end
game.Workspace.RemoteFunction.OnServerInvoke = function(...) errorDetected(select(2,...)) end
scriptService.Error:connect(errorDetected)
Look at dat efficiency :p

1 comment
I did notice this later on, my bad. And I replaced with message and it still didn't work, I'll edit now.