local Players = game:GetService("Players") local TextChatService = game:GetService("TextChatService") local UserInputService = game:GetService("UserInputService") local HttpService = game:GetService("HttpService") local player = Players.LocalPlayer --// SETTINGS local messages = {} local autoRandomEnabled = false local AUTO_RANDOM_DELAY = 5 local lastRandomIndex = nil --// SAVE FILE local SAVE_FILE = "ChatSenderYe_Messages.json" --// LOAD SAVED MESSAGES local function loadMessages() if not (isfile and readfile) then return end local success, result = pcall(function() if isfile(SAVE_FILE) then return HttpService:JSONDecode(readfile(SAVE_FILE)) end end) if success and type(result) == "table" then messages = result end end --// SAVE MESSAGES local function saveMessages() if not (writefile and HttpService) then return end pcall(function() writefile(SAVE_FILE, HttpService:JSONEncode(messages)) end) end loadMessages() --// GUI local gui = Instance.new("ScreenGui") gui.Name = "ChatSenderYe" gui.ResetOnSpawn = false gui.Parent = player:WaitForChild("PlayerGui") --// MAIN WINDOW local main = Instance.new("Frame") main.Size = UDim2.fromOffset(280, 350) main.Position = UDim2.new(0.5, -140, 0.5, -175) main.BackgroundColor3 = Color3.fromRGB(24, 24, 27) main.BorderSizePixel = 0 main.Parent = gui local mainCorner = Instance.new("UICorner") mainCorner.CornerRadius = UDim.new(0, 12) mainCorner.Parent = main --// HEADER local header = Instance.new("Frame") header.Size = UDim2.new(1, 0, 0, 45) header.BackgroundTransparency = 1 header.Active = true header.Parent = main local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -60, 1, 0) title.Position = UDim2.fromOffset(14, 0) title.BackgroundTransparency = 1 title.Text = "*chat sender ye" title.TextColor3 = Color3.fromRGB(235, 235, 235) title.TextSize = 17 title.Font = Enum.Font.GothamMedium title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = header --// MINIMIZE BUTTON local close = Instance.new("TextButton") close.Size = UDim2.fromOffset(38, 38) close.Position = UDim2.new(1, -43, 0, 3) close.BackgroundTransparency = 1 close.Text = "×" close.TextColor3 = Color3.fromRGB(170, 170, 175) close.TextSize = 25 close.Font = Enum.Font.Gotham close.Parent = header --// MINIMIZED CIRCLE local circle = Instance.new("TextButton") circle.Size = UDim2.fromOffset(55, 55) circle.Position = UDim2.new(0.5, -27, 0.5, -27) circle.BackgroundColor3 = Color3.fromRGB(35, 35, 40) circle.BorderSizePixel = 0 circle.Text = "💬" circle.TextSize = 25 circle.Visible = false circle.Active = true circle.Parent = gui local circleCorner = Instance.new("UICorner") circleCorner.CornerRadius = UDim.new(1, 0) circleCorner.Parent = circle --// INPUT local input = Instance.new("TextBox") input.Size = UDim2.new(1, -30, 0, 38) input.Position = UDim2.fromOffset(15, 50) input.BackgroundColor3 = Color3.fromRGB(34, 34, 38) input.BorderSizePixel = 0 input.PlaceholderText = "New message..." input.PlaceholderColor3 = Color3.fromRGB(120, 120, 125) input.TextColor3 = Color3.fromRGB(235, 235, 235) input.TextSize = 14 input.Font = Enum.Font.Gotham input.ClearTextOnFocus = false input.Parent = main Instance.new("UICorner", input).CornerRadius = UDim.new(0, 8) --// AUTO RANDOM BUTTON local autoButton = Instance.new("TextButton") autoButton.Size = UDim2.new(1, -30, 0, 32) autoButton.Position = UDim2.fromOffset(15, 94) autoButton.BackgroundColor3 = Color3.fromRGB(45, 45, 50) autoButton.BorderSizePixel = 0 autoButton.Text = "AUTO RANDOM • OFF" autoButton.TextColor3 = Color3.fromRGB(190, 190, 195) autoButton.TextSize = 13 autoButton.Font = Enum.Font.GothamMedium autoButton.Parent = main Instance.new("UICorner", autoButton).CornerRadius = UDim.new(0, 8) --// ADD BUTTON local add = Instance.new("TextButton") add.Size = UDim2.fromOffset(36, 36) add.Position = UDim2.new(1, -50, 1, -48) add.BackgroundColor3 = Color3.fromRGB(55, 55, 62) add.Text = "+" add.TextColor3 = Color3.fromRGB(255, 255, 255) add.TextSize = 22 add.Font = Enum.Font.GothamMedium add.Parent = main Instance.new("UICorner", add).CornerRadius = UDim.new(1, 0) --// MESSAGE LIST local list = Instance.new("ScrollingFrame") list.Size = UDim2.new(1, -30, 1, -185) list.Position = UDim2.fromOffset(15, 134) list.BackgroundTransparency = 1 list.BorderSizePixel = 0 list.ScrollBarThickness = 3 list.CanvasSize = UDim2.new() list.Parent = main local layout = Instance.new("UIListLayout") layout.Padding = UDim.new(0, 6) layout.SortOrder = Enum.SortOrder.LayoutOrder layout.Parent = list --// SEND MESSAGE local function sendMessage(message) if message == "" then return end local channels = TextChatService:FindFirstChild("TextChannels") if channels then local general = channels:FindFirstChild("RBXGeneral") if general then general:SendAsync(message) end end end --// REFRESH MESSAGE LIST local function refresh() for _, child in ipairs(list:GetChildren()) do if child:IsA("Frame") then child:Destroy() end end for index, message in ipairs(messages) do local row = Instance.new("Frame") row.Size = UDim2.new(1, 0, 0, 38) row.BackgroundTransparency = 1 row.BorderSizePixel = 0 row.Parent = list -- Message button local button = Instance.new("TextButton") button.Size = UDim2.new(1, -42, 1, 0) button.Position = UDim2.fromOffset(0, 0) button.BackgroundColor3 = Color3.fromRGB(34, 34, 38) button.BorderSizePixel = 0 button.Text = message button.TextColor3 = Color3.fromRGB(220, 220, 225) button.TextSize = 14 button.Font = Enum.Font.Gotham button.TextTruncate = Enum.TextTruncate.AtEnd button.Parent = row Instance.new("UICorner", button).CornerRadius = UDim.new(0, 8) -- Tap message to send button.Activated:Connect(function() sendMessage(message) end) --// RED DELETE X local delete = Instance.new("TextButton") delete.Size = UDim2.fromOffset(36, 36) delete.Position = UDim2.new(1, -36, 0, 1) delete.BackgroundColor3 = Color3.fromRGB(45, 45, 50) delete.BorderSizePixel = 0 delete.Text = "×" delete.TextColor3 = Color3.fromRGB(255, 70, 70) delete.TextSize = 22 delete.Font = Enum.Font.GothamMedium delete.Parent = row Instance.new("UICorner", delete).CornerRadius = UDim.new(0, 8) -- Delete message delete.Activated:Connect(function() table.remove(messages, index) -- Reset previous random selection if needed if lastRandomIndex == index then lastRandomIndex = nil elseif lastRandomIndex and index < lastRandomIndex then lastRandomIndex -= 1 end saveMessages() refresh() end) end task.wait() list.CanvasSize = UDim2.fromOffset( 0, layout.AbsoluteContentSize.Y + 5 ) end --// ADD MESSAGE local function addMessage() if input.Text ~= "" then table.insert(messages, input.Text) saveMessages() input.Text = "" refresh() end end add.Activated:Connect(addMessage) input.FocusLost:Connect(function(enterPressed) if enterPressed then addMessage() end end) --// AUTO RANDOM TOGGLE autoButton.Activated:Connect(function() autoRandomEnabled = not autoRandomEnabled if autoRandomEnabled then autoButton.Text = "AUTO RANDOM • ON" autoButton.BackgroundColor3 = Color3.fromRGB(65, 65, 72) autoButton.TextColor3 = Color3.fromRGB(255, 255, 255) else autoButton.Text = "AUTO RANDOM • OFF" autoButton.BackgroundColor3 = Color3.fromRGB(45, 45, 50) autoButton.TextColor3 = Color3.fromRGB(190, 190, 195) -- Reset previous selection lastRandomIndex = nil end end) --// AUTO RANDOM SENDER task.spawn(function() while gui.Parent do task.wait(AUTO_RANDOM_DELAY) if autoRandomEnabled and #messages > 0 then local randomIndex -- If there is only one message, -- it has no alternative to choose from. if #messages == 1 then randomIndex = 1 else repeat randomIndex = math.random(1, #messages) until randomIndex ~= lastRandomIndex end lastRandomIndex = randomIndex local randomMessage = messages[randomIndex] sendMessage(randomMessage) end end end) --// MINIMIZE close.Activated:Connect(function() main.Visible = false circle.Visible = true end) --// RESTORE circle.Activated:Connect(function() main.Visible = true circle.Visible = false end) -------------------------------------------------- -- MOBILE DRAG SYSTEM -------------------------------------------------- local function makeDraggable(object, dragArea) local dragging = false local dragStart local startPos dragArea.InputBegan:Connect(function(inputObject) if inputObject.UserInputType == Enum.UserInputType.Touch or inputObject.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragStart = inputObject.Position startPos = object.Position inputObject.Changed:Connect(function() if inputObject.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) UserInputService.InputChanged:Connect(function(inputObject) if not dragging then return end if inputObject.UserInputType == Enum.UserInputType.Touch or inputObject.UserInputType == Enum.UserInputType.MouseMovement then local delta = inputObject.Position - dragStart object.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end) end -- Main window: drag header makeDraggable(main, header) -- Circle: drag circle itself makeDraggable(circle, circle) -- Initial display refresh()