I was trying to make a new chat has been added event,so I will be able to tell if a new chat has been added to the table but it won't fire,why?

ChatLog = {}
--------------------------------------------------------
NewChatAdded = script.NewChatAdded
--------------------------------------------------------
NewChatAdded.Event:connect(function(ChatAdded)--When a new chat is added it will fire
	NumberOfChats = #ChatLog
	while wait() do--Keeps refreshing
		NumberOfChatsNow = #ChatLog
	end
		print("There were "..NumberOfChats.." Now there is "..NumberOfChatsNow)
end)
---------------------------------------------------------
game.Players.PlayerAdded:connect(function(Player)
	Player.Chatted:connect(function(Chat)
		table.insert(ChatLog,#ChatLog,Chat)--Inserts what the player chatted
			NewChatAdded:Fire()--Fires event
					
	end)
end)

I'm using the Server Console in my place not in solo nor studio.