-- LocalScript -- StarterPlayer > StarterPlayerScripts local Players = game:GetService("Players") local TextChatService = game:GetService("TextChatService") local UserInputService = game:GetService("UserInputService") local LocalPlayer = Players.LocalPlayer local targetPlayer = nil local enabled = false local lastRepeatedMessage = nil --================================================== -- GUI --================================================== local gui = Instance.new("ScreenGui") gui.Name = "ChatRepeaterGUI" gui.ResetOnSpawn = false gui.Parent = LocalPlayer:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Name = "Main" frame.Size = UDim2.fromOffset(320, 190) frame.Position = UDim2.new(0.5, -160, 0.5, -95) frame.BackgroundColor3 = Color3.fromRGB(25, 25, 30) frame.BorderSizePixel = 0 frame.Active = true frame.Parent = gui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 10) corner.Parent = frame --================================================== -- TITLE BAR --================================================== local titleBar = Instance.new("Frame") titleBar.Size = UDim2.new(1, 0, 0, 35) titleBar.BackgroundTransparency = 1 titleBar.Parent = frame local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -70, 1, 0) title.Position = UDim2.fromOffset(10, 0) title.BackgroundTransparency = 1 title.Text = "Chat Repeater" title.TextColor3 = Color3.new(1, 1, 1) title.TextSize = 20 title.Font = Enum.Font.GothamBold title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = titleBar local minimizeButton = Instance.new("TextButton") minimizeButton.Size = UDim2.fromOffset(30, 30) minimizeButton.Position = UDim2.new(1, -65, 0, 3) minimizeButton.BackgroundColor3 = Color3.fromRGB(45, 45, 55) minimizeButton.BorderSizePixel = 0 minimizeButton.Text = "-" minimizeButton.TextColor3 = Color3.new(1, 1, 1) minimizeButton.TextSize = 20 minimizeButton.Font = Enum.Font.GothamBold minimizeButton.Parent = titleBar local minCorner = Instance.new("UICorner") minCorner.CornerRadius = UDim.new(0, 6) minCorner.Parent = minimizeButton local closeButton = Instance.new("TextButton") closeButton.Size = UDim2.fromOffset(30, 30) closeButton.Position = UDim2.new(1, -33, 0, 3) closeButton.BackgroundColor3 = Color3.fromRGB(120, 45, 45) closeButton.BorderSizePixel = 0 closeButton.Text = "X" closeButton.TextColor3 = Color3.new(1, 1, 1) closeButton.TextSize = 14 closeButton.Font = Enum.Font.GothamBold closeButton.Parent = titleBar local closeCorner = Instance.new("UICorner") closeCorner.CornerRadius = UDim.new(0, 6) closeCorner.Parent = closeButton --================================================== -- CONTENT --================================================== local content = Instance.new("Frame") content.Name = "Content" content.Size = UDim2.new(1, 0, 1, -35) content.Position = UDim2.fromOffset(0, 35) content.BackgroundTransparency = 1 content.Parent = frame local targetBox = Instance.new("TextBox") targetBox.Size = UDim2.new(1, -30, 0, 40) targetBox.Position = UDim2.fromOffset(15, 10) targetBox.BackgroundColor3 = Color3.fromRGB(40, 40, 48) targetBox.BorderSizePixel = 0 targetBox.PlaceholderText = "Enter username..." targetBox.Text = "" targetBox.TextColor3 = Color3.new(1, 1, 1) targetBox.PlaceholderColor3 = Color3.fromRGB(150, 150, 150) targetBox.TextSize = 16 targetBox.Font = Enum.Font.Gotham targetBox.ClearTextOnFocus = false targetBox.Parent = content local targetCorner = Instance.new("UICorner") targetCorner.CornerRadius = UDim.new(0, 8) targetCorner.Parent = targetBox local status = Instance.new("TextLabel") status.Size = UDim2.new(1, -30, 0, 25) status.Position = UDim2.fromOffset(15, 53) status.BackgroundTransparency = 1 status.Text = "Target: None" status.TextColor3 = Color3.fromRGB(200, 200, 200) status.TextSize = 14 status.Font = Enum.Font.Gotham status.TextXAlignment = Enum.TextXAlignment.Left status.Parent = content local toggle = Instance.new("TextButton") toggle.Size = UDim2.new(1, -30, 0, 45) toggle.Position = UDim2.fromOffset(15, 90) toggle.BackgroundColor3 = Color3.fromRGB(60, 60, 70) toggle.BorderSizePixel = 0 toggle.Text = "START" toggle.TextColor3 = Color3.new(1, 1, 1) toggle.TextSize = 17 toggle.Font = Enum.Font.GothamBold toggle.Parent = content local toggleCorner = Instance.new("UICorner") toggleCorner.CornerRadius = UDim.new(0, 8) toggleCorner.Parent = toggle --================================================== -- MINIMIZE --================================================== local minimized = false local normalSize = UDim2.fromOffset(320, 190) local normalPosition = frame.Position minimizeButton.MouseButton1Click:Connect(function() minimized = not minimized if minimized then normalSize = frame.Size normalPosition = frame.Position frame.Size = UDim2.fromOffset(220, 35) content.Visible = false minimizeButton.Text = "+" else frame.Size = normalSize frame.Position = normalPosition content.Visible = true minimizeButton.Text = "-" end end) closeButton.MouseButton1Click:Connect(function() gui:Destroy() end) --================================================== -- DRAGGING --================================================== local dragging = false local dragStart local startPosition titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragStart = input.Position startPosition = frame.Position end end) titleBar.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end end) UserInputService.InputChanged:Connect(function(input) if not dragging then return end if input.UserInputType ~= Enum.UserInputType.MouseMovement then return end local delta = input.Position - dragStart frame.Position = UDim2.new( startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y ) end) --================================================== -- RESIZE --================================================== local resizeHandle = Instance.new("TextButton") resizeHandle.Name = "ResizeHandle" resizeHandle.Size = UDim2.fromOffset(18, 18) resizeHandle.Position = UDim2.new(1, -18, 1, -18) resizeHandle.BackgroundTransparency = 1 resizeHandle.Text = "↘" resizeHandle.TextColor3 = Color3.fromRGB(150, 150, 150) resizeHandle.TextSize = 14 resizeHandle.Font = Enum.Font.GothamBold resizeHandle.Parent = frame local resizing = false local resizeStart local resizeStartSize resizeHandle.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then resizing = true resizeStart = input.Position resizeStartSize = frame.AbsoluteSize end end) resizeHandle.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then resizing = false end end) UserInputService.InputChanged:Connect(function(input) if not resizing then return end if input.UserInputType ~= Enum.UserInputType.MouseMovement then return end local delta = input.Position - resizeStart local newWidth = math.clamp( resizeStartSize.X + delta.X, 220, 600 ) local newHeight = math.clamp( resizeStartSize.Y + delta.Y, 150, 500 ) frame.Size = UDim2.fromOffset(newWidth, newHeight) end) --================================================== -- FIND PLAYER --================================================== local function findTarget(input) input = input:lower():gsub("^%s+", ""):gsub("%s+$", "") if input == "" then return nil end local exactMatch = nil local partialMatch = nil for _, player in ipairs(Players:GetPlayers()) do local username = player.Name:lower() if username == input then exactMatch = player break end if username:sub(1, #input) == input then if partialMatch then return nil, "Multiple matches" end partialMatch = player end end return exactMatch or partialMatch end local function updateTarget() local player, errorMessage = findTarget(targetBox.Text) if player then targetPlayer = player status.Text = "Target: " .. player.Name status.TextColor3 = Color3.fromRGB(100, 255, 140) elseif errorMessage == "Multiple matches" then targetPlayer = nil status.Text = "Target: Multiple matches" status.TextColor3 = Color3.fromRGB(255, 200, 80) else targetPlayer = nil status.Text = "Target: Not found" status.TextColor3 = Color3.fromRGB(255, 100, 100) end end targetBox:GetPropertyChangedSignal("Text"):Connect(updateTarget) --================================================== -- START / STOP --================================================== toggle.MouseButton1Click:Connect(function() if enabled then enabled = false toggle.Text = "START" toggle.BackgroundColor3 = Color3.fromRGB(60, 60, 70) return end updateTarget() if not targetPlayer then return end enabled = true toggle.Text = "STOP" toggle.BackgroundColor3 = Color3.fromRGB(180, 60, 60) end) --================================================== -- CHAT REPEATER --================================================== TextChatService.MessageReceived:Connect(function(message) if not enabled then return end if not targetPlayer then return end local textSource = message.TextSource if not textSource then return end if textSource.UserId == LocalPlayer.UserId then return end if textSource.UserId ~= targetPlayer.UserId then return end if message.Text == "" then return end if message.Text == lastRepeatedMessage then return end lastRepeatedMessage = message.Text local generalChannel = TextChatService.TextChannels:FindFirstChild("RBXGeneral") if generalChannel then generalChannel:SendAsync(message.Text) end end) --================================================== -- TARGET LEAVES --================================================== Players.PlayerRemoving:Connect(function(player) if targetPlayer == player then targetPlayer = nil enabled = false status.Text = "Target left" status.TextColor3 = Color3.fromRGB(255, 100, 100) toggle.Text = "START" toggle.BackgroundColor3 = Color3.fromRGB(60, 60, 70) end end)