local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local player = Players.LocalPlayer local gui = Instance.new("ScreenGui") gui.Name = "ChatLogs" gui.ResetOnSpawn = false gui.Parent = player:WaitForChild("PlayerGui") local main = Instance.new("Frame", gui) main.Size = UDim2.new(0,260,0,300) main.Position = UDim2.new(0.05,0,0.25,0) main.BackgroundColor3 = Color3.fromRGB(15,15,15) main.BorderSizePixel = 0 Instance.new("UICorner", main).CornerRadius = UDim.new(0,16) local stroke = Instance.new("UIStroke", main) stroke.Transparency = 0.3 local header = Instance.new("Frame", main) header.Size = UDim2.new(1,0,0,36) header.BackgroundTransparency = 1 local titleLabel = Instance.new("TextLabel", header) titleLabel.Size = UDim2.new(0.6,0,1,0) titleLabel.Position = UDim2.new(0,10,0,0) titleLabel.BackgroundTransparency = 1 titleLabel.Text = "Chat Logs" titleLabel.TextColor3 = Color3.new(1,1,1) titleLabel.Font = Enum.Font.GothamBold titleLabel.TextSize = 14 titleLabel.TextXAlignment = Enum.TextXAlignment.Left local clearBtn = Instance.new("TextButton", header) clearBtn.Size = UDim2.new(0,32,0,24) clearBtn.Position = UDim2.new(1,-72,0.5,-12) clearBtn.Text = "✖" clearBtn.BackgroundColor3 = Color3.fromRGB(140,40,40) clearBtn.TextColor3 = Color3.new(1,1,1) clearBtn.BorderSizePixel = 0 clearBtn.Font = Enum.Font.GothamBold clearBtn.TextSize = 12 Instance.new("UICorner", clearBtn).CornerRadius = UDim.new(0,8) local minimizeBtn = Instance.new("TextButton", header) minimizeBtn.Size = UDim2.new(0,32,0,24) minimizeBtn.Position = UDim2.new(1,-36,0.5,-12) minimizeBtn.Text = "–" minimizeBtn.BackgroundColor3 = Color3.fromRGB(50,50,50) minimizeBtn.TextColor3 = Color3.new(1,1,1) minimizeBtn.BorderSizePixel = 0 minimizeBtn.Font = Enum.Font.GothamBold minimizeBtn.TextSize = 14 Instance.new("UICorner", minimizeBtn).CornerRadius = UDim.new(0,8) local scroll = Instance.new("ScrollingFrame", main) scroll.Size = UDim2.new(1,-10,1,-92) scroll.Position = UDim2.new(0,5,0,40) scroll.BackgroundColor3 = Color3.fromRGB(20,20,20) scroll.BorderSizePixel = 0 scroll.ScrollBarImageTransparency = 0 scroll.ScrollBarThickness = 6 Instance.new("UICorner", scroll).CornerRadius = UDim.new(0,12) local layout = Instance.new("UIListLayout", scroll) layout.Padding = UDim.new(0,6) layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() scroll.CanvasSize = UDim2.new(0,0,0,layout.AbsoluteContentSize.Y + 10) scroll.CanvasPosition = Vector2.new(0, scroll.CanvasSize.Y.Offset) end) local inputFrame = Instance.new("Frame", main) inputFrame.Size = UDim2.new(1,-10,0,40) inputFrame.Position = UDim2.new(0,5,1,-45) inputFrame.BackgroundColor3 = Color3.fromRGB(25,25,25) inputFrame.BorderSizePixel = 0 Instance.new("UICorner", inputFrame).CornerRadius = UDim.new(0,10) local inputBox = Instance.new("TextBox", inputFrame) inputBox.Size = UDim2.new(1,-10,1,-10) inputBox.Position = UDim2.new(0,5,0,5) inputBox.BackgroundTransparency = 1 inputBox.Text = "" inputBox.PlaceholderText = "Type here" inputBox.TextColor3 = Color3.new(1,1,1) inputBox.Font = Enum.Font.Gotham inputBox.TextSize = 13 inputBox.TextWrapped = true inputBox.ClearTextOnFocus = false local dragging, dragStart, startPos, minimized, normalSize normalSize = main.Size header.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = i.Position startPos = main.Position end end) UIS.InputChanged:Connect(function(i) if dragging then local delta = i.Position - dragStart main.Position = UDim2.new(startPos.X.Scale,startPos.X.Offset+delta.X,startPos.Y.Scale,startPos.Y.Offset+delta.Y) end end) UIS.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging = false end end) minimizeBtn.MouseButton1Click:Connect(function() minimized = not minimized if minimized then scroll.Visible = false inputFrame.Visible = false main.Size = UDim2.new(0,260,0,44) minimizeBtn.Text = "+" else scroll.Visible = true inputFrame.Visible = true main.Size = normalSize minimizeBtn.Text = "–" end end) local function addMessage(author, text) local container = Instance.new("Frame", scroll) container.Size = UDim2.new(1,-6,0,36) container.BackgroundColor3 = Color3.fromRGB(30,30,30) container.BorderSizePixel = 0 Instance.new("UICorner", container).CornerRadius = UDim.new(0,10) local lbl = Instance.new("TextLabel", container) lbl.Size = UDim2.new(1,-36,1,0) lbl.Position = UDim2.new(0,8,0,0) lbl.BackgroundTransparency = 1 lbl.TextWrapped = true lbl.TextXAlignment = Enum.TextXAlignment.Left lbl.TextYAlignment = Enum.TextYAlignment.Center lbl.TextColor3 = Color3.new(1,1,1) lbl.Font = Enum.Font.Gotham lbl.TextSize = 12 lbl.Text = (author ~= "" and (author..": "..text) or text) container.Size = UDim2.new(1,-6,0,lbl.TextBounds.Y + 12) end clearBtn.MouseButton1Click:Connect(function() for _, v in pairs(scroll:GetChildren()) do if v:IsA("Frame") then v:Destroy() end end end) inputBox.FocusLost:Connect(function(enter) if enter and inputBox.Text ~= "" then addMessage(player.Name, inputBox.Text) inputBox.Text = "" end end) for _, p in pairs(Players:GetPlayers()) do p.Chatted:Connect(function(msg) addMessage(p.Name, msg) end) end Players.PlayerAdded:Connect(function(p) p.Chatted:Connect(function(msg) addMessage(p.Name, msg) end) end) local succeedLabel = Instance.new("TextLabel", main) succeedLabel.Size = UDim2.new(1,0,0,24) succeedLabel.Position = UDim2.new(0,0,0,main.AbsoluteSize.Y - 24) succeedLabel.BackgroundColor3 = Color3.fromRGB(50,50,50) succeedLabel.TextColor3 = Color3.new(0,1,0) succeedLabel.Font = Enum.Font.GothamBold succeedLabel.TextSize = 14 succeedLabel.Text = "Succeed" succeedLabel.TextScaled = true succeedLabel.TextWrapped = true succeedLabel.BorderSizePixel = 0 Instance.new("UICorner", succeedLabel).CornerRadius = UDim.new(0,8) task.delay(2, function() succeedLabel:Destroy() end)