Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What's the most efficient way to make a Chat log?

I've tried doing a chat log using Tables and bindable functions,but it didn't turn out very efficient and the tables would mess up the order if someone chatted,so whats the most efficient way to make a Chat log or to make this thing more efficient?

Heres the Hierarchy

My Test Chat Log thing:

Chatlog = {}
------------------------------
InsertChat = script.InsertChat
PrintChatLog = script.PrintChatLog
------------------------------
function InsertChat.OnInvoke(Chat,Boolean)
		if Boolean == true then
			table.insert(Chatlog,#Chatlog,Chat)
			return Chat
		end
     
end
------------------------------
function PrintChatLog.OnInvoke()
		for i,v in pairs (Chatlog) do
			print(v)
		end
	
end
------------------------------

Separate script:

game.Players.PlayerAdded:connect(function(Player)
	Player.Chatted:connect(function(Message)
		------------------------------------------------
		InsertChat = game.workspace.ChatLog.InsertChat
		PrintChatLog = game.workspace.ChatLog.PrintChatLog
		------------------------------------------------
		InsertChat:Invoke(Message,true)
		wait()
		PrintChatLog:Invoke()
		end)
end)

I use the output in my place to test it.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.