Okay so here is the code:
chatlog = script.Parent.ChatLog
local chat = {}
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
chatlog.Value = player.Name..": "..msg
table.insert(chat, chatlog.Value)
for i=1,player do print(i)
print (chat[i])
end
end)
end)
I want it to add the value of chatlog every time function(msg) runs to the table. I believe the problem is the for loop. Thanks.

2 comments
for i = 1, #chat do print(i)
For future reference, please make your title relevant to the question inside.