Advertisement
TheDutchSoul

Updated Roblox Chat -voice logger script - save to workspace - VC logger wil be added in update

Jan 9th, 2025 (edited)
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.28 KB | Gaming | 0 0
  1.  
  2. print("Made by TheDutchSoul")
  3.  
  4. local StartUpMessage = "Welcome to Chat Log! | Made by TheDutchSoul"
  5. local Logging = true -- Controls whether the script is logging chats
  6. local ChatLogs = {} -- Table to store chat logs
  7. local VoiceLogs = {} -- Table to store voice chat logs
  8.  
  9. -- Parent GUI to CoreGui
  10. local ChatLog = Instance.new("ScreenGui")
  11. ChatLog.Name = "ChatLog"
  12. ChatLog.Parent = game.CoreGui
  13. ChatLog.ResetOnSpawn = false
  14.  
  15. -- Main Frame
  16. local Frame = Instance.new("Frame", ChatLog)
  17. Frame.BackgroundColor3 = Color3.fromRGB(90, 90, 90) -- Dark gray
  18. Frame.BackgroundTransparency = 0.3 -- Slight transparency for a modern look
  19. Frame.BorderSizePixel = 0
  20. Frame.Position = UDim2.new(0, 0, 1, -300) -- Position in the bottom-left corner
  21. Frame.Size = UDim2.new(0, 500, 0, 270)
  22. Frame.Visible = true
  23. Frame.Active = true
  24. Frame.Draggable = true
  25. Frame.AnchorPoint = Vector2.new(0, 1) -- Anchors to the bottom left corner
  26.  
  27. -- Add rounded corners for a modern look
  28. local Corner = Instance.new("UICorner", Frame)
  29. Corner.CornerRadius = UDim.new(0, 20)
  30.  
  31. -- Tabs Frame
  32. local TabsFrame = Instance.new("Frame", Frame)
  33. TabsFrame.Size = UDim2.new(1, 0, 0, 30)
  34. TabsFrame.Position = UDim2.new(0, 0, 0, 0)
  35. TabsFrame.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  36.  
  37. local ChatTabButton = Instance.new("TextButton", TabsFrame)
  38. ChatTabButton.Text = "Chat Logs"
  39. ChatTabButton.Size = UDim2.new(0.5, 0, 1, 0)
  40. ChatTabButton.BackgroundColor3 = Color3.fromRGB(90, 90, 90)
  41. ChatTabButton.Font = Enum.Font.SourceSansBold
  42. ChatTabButton.TextSize = 16
  43. ChatTabButton.TextColor3 = Color3.new(1, 1, 1)
  44.  
  45. local VoiceTabButton = Instance.new("TextButton", TabsFrame)
  46. VoiceTabButton.Text = "Voice Logs"
  47. VoiceTabButton.Size = UDim2.new(0.5, 0, 1, 0)
  48. VoiceTabButton.Position = UDim2.new(0.5, 0, 0, 0)
  49. VoiceTabButton.BackgroundColor3 = Color3.fromRGB(60, 60, 90)
  50. VoiceTabButton.Font = Enum.Font.SourceSansBold
  51. VoiceTabButton.TextSize = 16
  52. VoiceTabButton.TextColor3 = Color3.new(1, 1, 1)
  53.  
  54. -- Log Panels
  55. local ChatLogsPanel = Instance.new("ScrollingFrame", Frame)
  56. ChatLogsPanel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  57. ChatLogsPanel.BackgroundTransparency = 0.5 -- More transparency
  58. ChatLogsPanel.BorderSizePixel = 0
  59. ChatLogsPanel.Position = UDim2.new(0, 0, 0.1, 0)
  60. ChatLogsPanel.Size = UDim2.new(1, 0, 0.8, -10)
  61. ChatLogsPanel.CanvasSize = UDim2.new(0, 0, 0, 0)
  62. ChatLogsPanel.ScrollBarThickness = 10
  63.  
  64. local VoiceLogsPanel = Instance.new("ScrollingFrame", Frame)
  65. VoiceLogsPanel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  66. VoiceLogsPanel.BackgroundTransparency = 0.5
  67. VoiceLogsPanel.BorderSizePixel = 0
  68. VoiceLogsPanel.Position = ChatLogsPanel.Position
  69. VoiceLogsPanel.Size = ChatLogsPanel.Size
  70. VoiceLogsPanel.CanvasSize = UDim2.new(0, 0, 0, 0)
  71. VoiceLogsPanel.ScrollBarThickness = 10
  72. VoiceLogsPanel.Visible = false
  73.  
  74. ChatTabButton.MouseButton1Click:Connect(function()
  75.     ChatLogsPanel.Visible = true
  76.     VoiceLogsPanel.Visible = false
  77. end)
  78.  
  79. VoiceTabButton.MouseButton1Click:Connect(function()
  80.     ChatLogsPanel.Visible = false
  81.     VoiceLogsPanel.Visible = true
  82. end)
  83.  
  84. -- Buttons Frame (New Button Bar at the bottom)
  85. local ButtonsFrame = Instance.new("Frame", ChatLog)
  86. ButtonsFrame.Size = UDim2.new(0, 500, 0, 30)
  87. ButtonsFrame.Position = UDim2.new(0, 0, 1, -30)
  88. ButtonsFrame.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  89.  
  90. -- Status Button
  91. local StatusButton = Instance.new("TextButton", ButtonsFrame)
  92. StatusButton.Text = "Online"
  93. StatusButton.Size = UDim2.new(0, 100, 1, -10)
  94. StatusButton.Position = UDim2.new(0, 10, 0, 5)
  95. StatusButton.BackgroundColor3 = Color3.fromRGB(30, 120, 30)
  96. StatusButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  97. StatusButton.Font = Enum.Font.SourceSansBold
  98. StatusButton.TextSize = 16
  99.  
  100. -- Apply rounded corners to the Status button
  101. local StatusButtonCorner = Instance.new("UICorner", StatusButton)
  102. StatusButtonCorner.CornerRadius = UDim.new(0, 10)
  103.  
  104. -- Toggle Online/Offline
  105. StatusButton.MouseButton1Click:Connect(function()
  106.     Logging = not Logging
  107.     if Logging then
  108.         StatusButton.Text = "Online"
  109.         StatusButton.BackgroundColor3 = Color3.fromRGB(30, 120, 30)
  110.     else
  111.         StatusButton.Text = "Offline"
  112.         StatusButton.BackgroundColor3 = Color3.fromRGB(120, 30, 30)
  113.     end
  114. end)
  115.  
  116. -- Save Button
  117. local SaveButton = Instance.new("TextButton", ButtonsFrame)
  118. SaveButton.Text = "Save"
  119. SaveButton.Size = UDim2.new(0, 100, 1, -10)
  120. SaveButton.Position = UDim2.new(1, -110, 0, 5)
  121. SaveButton.BackgroundColor3 = Color3.fromRGB(50, 50, 200)
  122. SaveButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  123. SaveButton.Font = Enum.Font.SourceSansBold
  124. SaveButton.TextSize = 16
  125.  
  126. -- Apply rounded corners to the Save button
  127. local SaveButtonCorner = Instance.new("UICorner", SaveButton)
  128. SaveButtonCorner.CornerRadius = UDim.new(0, 10)
  129.  
  130. SaveButton.MouseButton1Click:Connect(function()
  131.     if #ChatLogs == 0 then
  132.         print("No chat logs to save!")
  133.         return
  134.     end
  135.  
  136.     local SaveString = table.concat(ChatLogs, "\n")
  137.     writefile("ChatLogs.txt", SaveString)
  138.     print("Chat logs saved to workspace as 'ChatLogs.txt'")
  139.  
  140.     -- Pop-up Message (Success) in the game (outside GUI)
  141.     local PopUpMessage = Instance.new("ScreenGui")
  142.     PopUpMessage.Name = "PopUpMessage"
  143.     PopUpMessage.Parent = game.CoreGui
  144.  
  145.     local PopUpLabel = Instance.new("TextLabel", PopUpMessage)
  146.     PopUpLabel.Text = "Chat logs saved in your workspace"
  147.     PopUpLabel.Font = Enum.Font.SourceSansBold
  148.     PopUpLabel.TextSize = 20
  149.     PopUpLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  150.     PopUpLabel.BackgroundTransparency = 1
  151.     PopUpLabel.Position = UDim2.new(0.5, -150, 0.5, -30)
  152.     PopUpLabel.Size = UDim2.new(0, 300, 0, 60)
  153.  
  154.     -- Remove the pop-up after 3 seconds
  155.     wait(3)
  156.     PopUpMessage:Destroy()
  157. end)
  158.  
  159. -- Log Message Function
  160. local function logMessage(player, message, isPrivate)
  161.     if not Logging then return end
  162.  
  163.     if #ChatLogs >= 1000 then
  164.         table.remove(ChatLogs, 1)
  165.     end
  166.  
  167.     local logText = string.format("[%s]: %s", player.Name, message)
  168.     table.insert(ChatLogs, logText)
  169.  
  170.     local LogFrame = Instance.new("Frame", ChatLogsPanel)
  171.     LogFrame.BackgroundTransparency = 1
  172.     LogFrame.Size = UDim2.new(1, -10, 0, 20)
  173.     LogFrame.Position = UDim2.new(0, 5, 0, (#ChatLogsPanel:GetChildren() - 1) * 20)
  174.  
  175.     local NameLabel = Instance.new("TextLabel", LogFrame)
  176.     NameLabel.BackgroundTransparency = 1
  177.     NameLabel.Font = Enum.Font.SourceSansBold
  178.     NameLabel.TextSize = 14
  179.     NameLabel.TextXAlignment = Enum.TextXAlignment.Left
  180.     NameLabel.Size = UDim2.new(0, 100, 1, 0)
  181.     NameLabel.Text = isPrivate and "[Private] " .. player.Name or player.Name
  182.     NameLabel.TextColor3 = isPrivate and Color3.fromRGB(128, 0, 128) or Color3.fromRGB(0, 255, 0)
  183.  
  184.     local MessageLabel = Instance.new("TextLabel", LogFrame)
  185.     MessageLabel.BackgroundTransparency = 1
  186.     MessageLabel.Font = Enum.Font.SourceSans
  187.     MessageLabel.TextSize = 14
  188.     MessageLabel.TextXAlignment = Enum.TextXAlignment.Left
  189.     MessageLabel.Position = UDim2.new(0, 110, 0, 0)
  190.     MessageLabel.Size = UDim2.new(1, -110, 1, 0)
  191.     MessageLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  192.     MessageLabel.Text = message
  193.  
  194.     ChatLogsPanel.CanvasSize = UDim2.new(0, 0, 0, (#ChatLogs * 20))
  195. end
  196.  
  197. -- Log Voice Message Function
  198. local function logVoiceMessage(playerName, message)
  199.     -- No default simulated messages anymore
  200. end
  201.  
  202. -- Chat Listener aanpassen om privéberichten te detecteren
  203. local function onPlayerChat(player)
  204.     player.Chatted:Connect(function(message)
  205.         local isPrivate = false
  206.         if string.sub(message, 1, 3) == "/w " then
  207.             isPrivate = true
  208.             message = string.sub(message, 4) -- Remove "/w " prefix for display
  209.         end
  210.         logMessage(player, message, isPrivate)
  211.     end)
  212. end
  213.  
  214. -- Setup listeners for all players
  215. for _, player in pairs(game.Players:GetPlayers()) do
  216.     onPlayerChat(player)
  217. end
  218.  
  219. game.Players.PlayerAdded:Connect(function(player)
  220.     onPlayerChat(player)
  221. end)
  222.  
  223. -- Keybind to toggle GUI visibility
  224. local UserInputService = game:GetService("UserInputService")
  225.  
  226. UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
  227.     if gameProcessedEvent then return end
  228.     if input.KeyCode == Enum.KeyCode.K then
  229.         Frame.Visible = not Frame.Visible
  230.         ButtonsFrame.Visible = not ButtonsFrame.Visible
  231.     end
  232. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement