Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local index = 0
- local history = {}
- hook.Add("OnPlayerChat", "chat_history", function(ply, text)
- if ply == LocalPlayer() then
- table.insert(history, text)
- index = math.huge
- end
- end)
- hook.Add("OnChatTab", "chat_history", function()
- if input.IsKeyDown(KEY_UP) then
- index = math.Clamp(index - 1, 0, #history)
- return history[index]
- elseif input.IsKeyDown(KEY_DOWN) then
- index = math.Clamp(index + 1, 0, #history)
- return history[index]
- end
- end)
- --[[
- hold up or down and press tab to browse your chat history. I know it's ass needing to press tab to do this, but it's the only way pretty much without using a module
- ]]
Advertisement
Add Comment
Please, Sign In to add comment