Issue with Error Logs

  1. I want to make Error Logs Gui for everyone to see in-game errors to debug it

  2. For some reasons this script won’t work

local ScriptContext = game:GetService("ScriptContext")

ScriptContext.Error:Connect(function(Message, Trace, Script)
print("Found Error")
for i,v in pairs(game.Players:GetChildren()) do
		print(v)
		local Gui = v.PlayerGui:WaitForChild("ErrorLogsForEveryone")
		local Clone = Gui.MainFrame.Template:Clone()
		Clone.Visible = true
		Clone.Text = "Problem: "..Message.."\nLine: "..Trace
		Clone.Parent = Gui.MainFrame
end
end)

I checked and for some reasons script stops working when reaches for i,v without errors

2 Likes