Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chatTable = {}
- local messages = 0
- ui.addTextArea(1, "", nil, 200, 100, 400, 300, 0x6E4720, 0x6E4720, 0.8, true)
- function updateTheChat()
- if chatTable then
- table.sort(chatTable, function(p1,p2) return p1.id > p2.id end)
- local text = ""
- for n,log in next, chatTable do
- text = text .. "<v>["..log.player.."]</v><n> " .. log.msg.. "</n>\n"
- end
- ui.updateTextArea(1,text)
- end
- end
- function eventChatMessage(name, msg)
- messages = messages + 1
- chatTable[#chatTable + 1] = {player = name, msg = msg, id = messages}
- updateTheChat()
- end
Add Comment
Please, Sign In to add comment