Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Made by TheDutchSoul")
- local StartUpMessage = "Welcome to Chat Log! | Made by TheDutchSoul"
- local Logging = true -- Controls whether the script is logging chats
- local ChatLogs = {} -- Table to store chat logs
- local VoiceLogs = {} -- Table to store voice chat logs
- -- Parent GUI to CoreGui
- local ChatLog = Instance.new("ScreenGui")
- ChatLog.Name = "ChatLog"
- ChatLog.Parent = game.CoreGui
- ChatLog.ResetOnSpawn = false
- -- Main Frame
- local Frame = Instance.new("Frame", ChatLog)
- Frame.BackgroundColor3 = Color3.fromRGB(90, 90, 90) -- Dark gray
- Frame.BackgroundTransparency = 0.3 -- Slight transparency for a modern look
- Frame.BorderSizePixel = 0
- Frame.Position = UDim2.new(0, 0, 1, -300) -- Position in the bottom-left corner
- Frame.Size = UDim2.new(0, 500, 0, 270)
- Frame.Visible = true
- Frame.Active = true
- Frame.Draggable = true
- Frame.AnchorPoint = Vector2.new(0, 1) -- Anchors to the bottom left corner
- -- Add rounded corners for a modern look
- local Corner = Instance.new("UICorner", Frame)
- Corner.CornerRadius = UDim.new(0, 20)
- -- Tabs Frame
- local TabsFrame = Instance.new("Frame", Frame)
- TabsFrame.Size = UDim2.new(1, 0, 0, 30)
- TabsFrame.Position = UDim2.new(0, 0, 0, 0)
- TabsFrame.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- local ChatTabButton = Instance.new("TextButton", TabsFrame)
- ChatTabButton.Text = "Chat Logs"
- ChatTabButton.Size = UDim2.new(0.5, 0, 1, 0)
- ChatTabButton.BackgroundColor3 = Color3.fromRGB(90, 90, 90)
- ChatTabButton.Font = Enum.Font.SourceSansBold
- ChatTabButton.TextSize = 16
- ChatTabButton.TextColor3 = Color3.new(1, 1, 1)
- local VoiceTabButton = Instance.new("TextButton", TabsFrame)
- VoiceTabButton.Text = "Voice Logs"
- VoiceTabButton.Size = UDim2.new(0.5, 0, 1, 0)
- VoiceTabButton.Position = UDim2.new(0.5, 0, 0, 0)
- VoiceTabButton.BackgroundColor3 = Color3.fromRGB(60, 60, 90)
- VoiceTabButton.Font = Enum.Font.SourceSansBold
- VoiceTabButton.TextSize = 16
- VoiceTabButton.TextColor3 = Color3.new(1, 1, 1)
- -- Log Panels
- local ChatLogsPanel = Instance.new("ScrollingFrame", Frame)
- ChatLogsPanel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- ChatLogsPanel.BackgroundTransparency = 0.5 -- More transparency
- ChatLogsPanel.BorderSizePixel = 0
- ChatLogsPanel.Position = UDim2.new(0, 0, 0.1, 0)
- ChatLogsPanel.Size = UDim2.new(1, 0, 0.8, -10)
- ChatLogsPanel.CanvasSize = UDim2.new(0, 0, 0, 0)
- ChatLogsPanel.ScrollBarThickness = 10
- local VoiceLogsPanel = Instance.new("ScrollingFrame", Frame)
- VoiceLogsPanel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- VoiceLogsPanel.BackgroundTransparency = 0.5
- VoiceLogsPanel.BorderSizePixel = 0
- VoiceLogsPanel.Position = ChatLogsPanel.Position
- VoiceLogsPanel.Size = ChatLogsPanel.Size
- VoiceLogsPanel.CanvasSize = UDim2.new(0, 0, 0, 0)
- VoiceLogsPanel.ScrollBarThickness = 10
- VoiceLogsPanel.Visible = false
- ChatTabButton.MouseButton1Click:Connect(function()
- ChatLogsPanel.Visible = true
- VoiceLogsPanel.Visible = false
- end)
- VoiceTabButton.MouseButton1Click:Connect(function()
- ChatLogsPanel.Visible = false
- VoiceLogsPanel.Visible = true
- end)
- -- Buttons Frame (New Button Bar at the bottom)
- local ButtonsFrame = Instance.new("Frame", ChatLog)
- ButtonsFrame.Size = UDim2.new(0, 500, 0, 30)
- ButtonsFrame.Position = UDim2.new(0, 0, 1, -30)
- ButtonsFrame.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- -- Status Button
- local StatusButton = Instance.new("TextButton", ButtonsFrame)
- StatusButton.Text = "Online"
- StatusButton.Size = UDim2.new(0, 100, 1, -10)
- StatusButton.Position = UDim2.new(0, 10, 0, 5)
- StatusButton.BackgroundColor3 = Color3.fromRGB(30, 120, 30)
- StatusButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- StatusButton.Font = Enum.Font.SourceSansBold
- StatusButton.TextSize = 16
- -- Apply rounded corners to the Status button
- local StatusButtonCorner = Instance.new("UICorner", StatusButton)
- StatusButtonCorner.CornerRadius = UDim.new(0, 10)
- -- Toggle Online/Offline
- StatusButton.MouseButton1Click:Connect(function()
- Logging = not Logging
- if Logging then
- StatusButton.Text = "Online"
- StatusButton.BackgroundColor3 = Color3.fromRGB(30, 120, 30)
- else
- StatusButton.Text = "Offline"
- StatusButton.BackgroundColor3 = Color3.fromRGB(120, 30, 30)
- end
- end)
- -- Save Button
- local SaveButton = Instance.new("TextButton", ButtonsFrame)
- SaveButton.Text = "Save"
- SaveButton.Size = UDim2.new(0, 100, 1, -10)
- SaveButton.Position = UDim2.new(1, -110, 0, 5)
- SaveButton.BackgroundColor3 = Color3.fromRGB(50, 50, 200)
- SaveButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- SaveButton.Font = Enum.Font.SourceSansBold
- SaveButton.TextSize = 16
- -- Apply rounded corners to the Save button
- local SaveButtonCorner = Instance.new("UICorner", SaveButton)
- SaveButtonCorner.CornerRadius = UDim.new(0, 10)
- SaveButton.MouseButton1Click:Connect(function()
- if #ChatLogs == 0 then
- print("No chat logs to save!")
- return
- end
- local SaveString = table.concat(ChatLogs, "\n")
- writefile("ChatLogs.txt", SaveString)
- print("Chat logs saved to workspace as 'ChatLogs.txt'")
- -- Pop-up Message (Success) in the game (outside GUI)
- local PopUpMessage = Instance.new("ScreenGui")
- PopUpMessage.Name = "PopUpMessage"
- PopUpMessage.Parent = game.CoreGui
- local PopUpLabel = Instance.new("TextLabel", PopUpMessage)
- PopUpLabel.Text = "Chat logs saved in your workspace"
- PopUpLabel.Font = Enum.Font.SourceSansBold
- PopUpLabel.TextSize = 20
- PopUpLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- PopUpLabel.BackgroundTransparency = 1
- PopUpLabel.Position = UDim2.new(0.5, -150, 0.5, -30)
- PopUpLabel.Size = UDim2.new(0, 300, 0, 60)
- -- Remove the pop-up after 3 seconds
- wait(3)
- PopUpMessage:Destroy()
- end)
- -- Log Message Function
- local function logMessage(player, message, isPrivate)
- if not Logging then return end
- if #ChatLogs >= 1000 then
- table.remove(ChatLogs, 1)
- end
- local logText = string.format("[%s]: %s", player.Name, message)
- table.insert(ChatLogs, logText)
- local LogFrame = Instance.new("Frame", ChatLogsPanel)
- LogFrame.BackgroundTransparency = 1
- LogFrame.Size = UDim2.new(1, -10, 0, 20)
- LogFrame.Position = UDim2.new(0, 5, 0, (#ChatLogsPanel:GetChildren() - 1) * 20)
- local NameLabel = Instance.new("TextLabel", LogFrame)
- NameLabel.BackgroundTransparency = 1
- NameLabel.Font = Enum.Font.SourceSansBold
- NameLabel.TextSize = 14
- NameLabel.TextXAlignment = Enum.TextXAlignment.Left
- NameLabel.Size = UDim2.new(0, 100, 1, 0)
- NameLabel.Text = isPrivate and "[Private] " .. player.Name or player.Name
- NameLabel.TextColor3 = isPrivate and Color3.fromRGB(128, 0, 128) or Color3.fromRGB(0, 255, 0)
- local MessageLabel = Instance.new("TextLabel", LogFrame)
- MessageLabel.BackgroundTransparency = 1
- MessageLabel.Font = Enum.Font.SourceSans
- MessageLabel.TextSize = 14
- MessageLabel.TextXAlignment = Enum.TextXAlignment.Left
- MessageLabel.Position = UDim2.new(0, 110, 0, 0)
- MessageLabel.Size = UDim2.new(1, -110, 1, 0)
- MessageLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- MessageLabel.Text = message
- ChatLogsPanel.CanvasSize = UDim2.new(0, 0, 0, (#ChatLogs * 20))
- end
- -- Log Voice Message Function
- local function logVoiceMessage(playerName, message)
- -- No default simulated messages anymore
- end
- -- Chat Listener aanpassen om privéberichten te detecteren
- local function onPlayerChat(player)
- player.Chatted:Connect(function(message)
- local isPrivate = false
- if string.sub(message, 1, 3) == "/w " then
- isPrivate = true
- message = string.sub(message, 4) -- Remove "/w " prefix for display
- end
- logMessage(player, message, isPrivate)
- end)
- end
- -- Setup listeners for all players
- for _, player in pairs(game.Players:GetPlayers()) do
- onPlayerChat(player)
- end
- game.Players.PlayerAdded:Connect(function(player)
- onPlayerChat(player)
- end)
- -- Keybind to toggle GUI visibility
- local UserInputService = game:GetService("UserInputService")
- UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
- if gameProcessedEvent then return end
- if input.KeyCode == Enum.KeyCode.K then
- Frame.Visible = not Frame.Visible
- ButtonsFrame.Visible = not ButtonsFrame.Visible
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement