Dark_Agent

FE Replicatesignal ChatEditor

Nov 17th, 2025 (edited)
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 33.32 KB | Gaming | 0 0
  1. --[[
  2.     Chat-Editor ✒️
  3.     .Message from agent666_0.
  4.    
  5.     Farhat#9879: I used Ai because...
  6.     I'm not good at Gui making stuff
  7.     but some parts i taked from Infinite yield  
  8.     and i found that signal that edites messages
  9. --]]
  10. local function missing(t, f, fallback)
  11.     if type(f) == t then
  12.         return f
  13.     end
  14.     return fallback
  15. end
  16.  
  17. local waxwritefile, waxreadfile = writefile, readfile
  18. writefile = missing("function", waxwritefile) and function(file, data, safe)
  19.     if safe == true then
  20.         return pcall(waxwritefile, file, data)
  21.     end
  22.     waxwritefile(file, data)
  23. end
  24.  
  25. readfile = missing("function", waxreadfile) and function(file, safe)
  26.     if safe == true then
  27.         return pcall(waxreadfile, file)
  28.     end
  29.     return waxreadfile(file)
  30. end
  31.  
  32. isfile = missing("function", isfile, readfile and function(file)
  33.     local success, result = pcall(function() return readfile(file) end)
  34.     return success and result ~= nil and result ~= ""
  35. end)
  36.  
  37. makefolder = missing("function", makefolder)
  38. isfolder = missing("function", isfolder)
  39. delfile = missing("function", delfile)
  40. renamefile = missing("function", appendfile)
  41.  
  42. local Config = {
  43.     WindowTitle = "Chat-Editor ✒️",
  44.     DefaultCooldown = 5,
  45.     DefaultCacheMessage = ".",
  46.     UniqueGuiName = "ChatEditorScreenGui",
  47.     SaveFolder = "ChatEditor",
  48.     GlobalConfigFile = "Config.json"
  49. }
  50.  
  51. local library = {}
  52.  
  53. local function makeDraggable(topbar, window, UserInputService)
  54.     local isDragging = false
  55.     local dragStart, startPos, moveConnection, upConnection
  56.  
  57.     topbar.InputBegan:Connect(function(input)
  58.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  59.             isDragging = true
  60.             dragStart = input.Position
  61.             startPos = window.Position
  62.  
  63.             moveConnection = UserInputService.InputChanged:Connect(function(moveInput)
  64.                 if isDragging and (moveInput.UserInputType == Enum.UserInputType.MouseMovement or moveInput.UserInputType == Enum.UserInputType.Touch) then
  65.                     local delta = moveInput.Position - dragStart
  66.                     window.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  67.                 end
  68.             end)
  69.  
  70.             upConnection = UserInputService.InputEnded:Connect(function(upInput)
  71.                 if upInput.UserInputType == Enum.UserInputType.MouseButton1 or upInput.UserInputType == Enum.UserInputType.Touch then
  72.                     isDragging = false
  73.                     if moveConnection then moveConnection:Disconnect() end
  74.                     if upConnection then upConnection:Disconnect() end
  75.                 end
  76.             end)
  77.         end
  78.     end)
  79. end
  80.  
  81. function library:CreateWindow(title, parent, UserInputService)
  82.     local screenGui = Instance.new("ScreenGui")
  83.     screenGui.Name = Config.UniqueGuiName
  84.     screenGui.DisplayOrder = 999
  85.     screenGui.ResetOnSpawn = false
  86.     screenGui.IgnoreGuiInset = true
  87.     screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  88.  
  89.     local mainFrame = Instance.new("Frame", screenGui)
  90.     mainFrame.Name = "MainWindow"
  91.     mainFrame.Size = UDim2.new(0, 450, 0, 380)
  92.     mainFrame.Position = UDim2.new(0.5, -225, 0.5, -190)
  93.     mainFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 45)
  94.     mainFrame.BorderColor3 = Color3.fromRGB(80, 80, 100)
  95.     mainFrame.BorderSizePixel = 1
  96.     mainFrame.ClipsDescendants = true
  97.    
  98.     local uiCorner = Instance.new("UICorner", mainFrame)
  99.     uiCorner.CornerRadius = UDim.new(0, 6)
  100.  
  101.     local shadow = Instance.new("ImageLabel", mainFrame)
  102.     shadow.Name = "Shadow"
  103.     shadow.BackgroundTransparency = 1
  104.     shadow.Image = "rbxassetid://12489812400"
  105.     shadow.ImageColor3 = Color3.new(0, 0, 0)
  106.     shadow.ImageTransparency = 0.5
  107.     shadow.ScaleType = Enum.ScaleType.Slice
  108.     shadow.SliceCenter = Rect.new(20, 20, 280, 280)
  109.     shadow.Size = UDim2.new(1, 10, 1, 10)
  110.     shadow.Position = UDim2.new(0.5, 0, 0.5, 0)
  111.     shadow.AnchorPoint = Vector2.new(0.5, 0.5)
  112.     shadow.ZIndex = -1
  113.     shadow.Visible = false
  114.  
  115.     local topBar = Instance.new("Frame", mainFrame)
  116.     topBar.Name = "TopBar"
  117.     topBar.Size = UDim2.new(1, 0, 0, 30)
  118.     topBar.BackgroundColor3 = Color3.fromRGB(45, 45, 55)
  119.     topBar.BorderSizePixel = 0
  120.  
  121.     local titleLabel = Instance.new("TextLabel", topBar)
  122.     titleLabel.Name = "Title"
  123.     titleLabel.Size = UDim2.new(1, -60, 1, 0)
  124.     titleLabel.Position = UDim2.new(0, 5, 0, 0)
  125.     titleLabel.BackgroundTransparency = 1
  126.     titleLabel.Font = Enum.Font.SourceSans
  127.     titleLabel.TextColor3 = Color3.fromRGB(220, 220, 220)
  128.     titleLabel.Text = title or "Window"
  129.     titleLabel.TextSize = 16
  130.     titleLabel.TextXAlignment = Enum.TextXAlignment.Left
  131.  
  132.     local closeButton = Instance.new("TextButton", topBar)
  133.     closeButton.Name = "CloseButton"
  134.     closeButton.Size = UDim2.new(0, 30, 1, 0)
  135.     closeButton.Position = UDim2.new(1, -30, 0, 0)
  136.     closeButton.BackgroundColor3 = topBar.BackgroundColor3
  137.     closeButton.Font = Enum.Font.SourceSansBold
  138.     closeButton.TextColor3 = Color3.fromRGB(220, 220, 220)
  139.     closeButton.Text = "X"
  140.     closeButton.TextSize = 16
  141.     closeButton.BorderSizePixel = 0
  142.     closeButton.MouseButton1Click:Connect(function() screenGui:Destroy() end)
  143.  
  144.     local settingsButton = Instance.new("TextButton", topBar)
  145.     settingsButton.Name = "SettingsButton"
  146.     settingsButton.Size = UDim2.new(0, 30, 1, 0)
  147.     settingsButton.Position = UDim2.new(1, -60, 0, 0)
  148.     settingsButton.BackgroundColor3 = topBar.BackgroundColor3
  149.     settingsButton.Font = Enum.Font.SourceSans
  150.     settingsButton.TextColor3 = Color3.fromRGB(220, 220, 220)
  151.     settingsButton.Text = "⚙️"
  152.     settingsButton.TextSize = 16
  153.     settingsButton.BorderSizePixel = 0
  154.  
  155.     local contentFrame = Instance.new("Frame", mainFrame)
  156.     contentFrame.Name = "Content"
  157.     contentFrame.Size = UDim2.new(1, 0, 1, -30)
  158.     contentFrame.Position = UDim2.new(0, 0, 0, 30)
  159.     contentFrame.BackgroundTransparency = 1
  160.     contentFrame.BorderSizePixel = 0
  161.  
  162.     local settingsFrame = Instance.new("Frame", mainFrame)
  163.     settingsFrame.Name = "Settings"
  164.     settingsFrame.Size = UDim2.new(1, 0, 1, -30)
  165.     settingsFrame.Position = UDim2.new(0, 0, 0, 30)
  166.     settingsFrame.BackgroundColor3 = mainFrame.BackgroundColor3
  167.     settingsFrame.BorderSizePixel = 0
  168.     settingsFrame.Visible = false
  169.  
  170.     local settingsListLayout = Instance.new("UIListLayout", settingsFrame)
  171.     settingsListLayout.Padding = UDim.new(0, 10)
  172.     settingsListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  173.     settingsListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  174.  
  175.     local settingsPadding = Instance.new("UIPadding", settingsFrame)
  176.     settingsPadding.PaddingTop = UDim.new(0, 15)
  177.     settingsPadding.PaddingLeft = UDim.new(0, 15)
  178.     settingsPadding.PaddingRight = UDim.new(0, 15)
  179.  
  180.     settingsButton.MouseButton1Click:Connect(function() settingsFrame.Visible = not settingsFrame.Visible end)
  181.     makeDraggable(topBar, mainFrame, UserInputService)
  182.     screenGui.Parent = parent
  183.  
  184.     return { Root = screenGui, Container = contentFrame, SettingsContainer = settingsFrame, MainWindow = mainFrame, Shadow = shadow }
  185. end
  186.  
  187. local cloneref = missing("function", cloneref, function(...) return ... end)
  188. local replicatesignal = missing("function", replicatesignal)
  189.  
  190. local Services = setmetatable({}, {
  191.     __index = function(self, name)
  192.         local success, cache = pcall(function() return cloneref(game:GetService(name)) end)
  193.         if success then
  194.             rawset(self, name, cache)
  195.             return cache
  196.         else
  197.             error("Invalid Roblox Service: " .. tostring(name))
  198.         end
  199.     end
  200. })
  201.  
  202. local Players = Services.Players
  203. local TextChatService = Services.TextChatService
  204. local CoreGui = Services.CoreGui
  205. local RunService = Services.RunService
  206. local UserInputService = Services.UserInputService
  207. local HttpService = Services.HttpService
  208.  
  209. if CoreGui:FindFirstChild(Config.UniqueGuiName) then CoreGui[Config.UniqueGuiName]:Destroy(); print("Chat-Editor: Removed an old instance.") end
  210.  
  211. local player = Players.LocalPlayer
  212. local channel = TextChatService.TextChannels.RBXGeneral
  213. local speaker = channel:WaitForChild(player.Name)
  214. local signal = TextChatService.ClientToServerMessageReplicateSignalV2
  215.  
  216. local state = {
  217.     messageId = nil,
  218.     cooldown = Config.DefaultCooldown,
  219.     cacheMessage = Config.DefaultCacheMessage,
  220.     isSequenceRunning = false,
  221.     globalSettings = { transparency = 0, shadow = false },
  222.     tabs = {},
  223.     activeTabIndex = 1
  224. }
  225.  
  226. local window = library:CreateWindow(Config.WindowTitle, CoreGui, UserInputService)
  227. local messageEntries = {}
  228. local tabButtons = {}
  229.  
  230. local createMessageEntry, saveGlobalConfig, saveCurrentTabData
  231. local shadowCheckbox, transparencySlider, cacheInput
  232. local createTabButton, switchTab, addTab, deleteTab
  233.  
  234. local tabContainer = Instance.new("Frame", window.Container)
  235. tabContainer.Size = UDim2.new(1, 0, 0, 35)
  236. tabContainer.BackgroundTransparency = 1
  237.  
  238. local tabScrollingFrame = Instance.new("ScrollingFrame", tabContainer)
  239. tabScrollingFrame.Size = UDim2.new(1, -35, 1, 0)
  240. tabScrollingFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
  241. tabScrollingFrame.BorderSizePixel = 0
  242. tabScrollingFrame.CanvasSize = UDim2.new()
  243. tabScrollingFrame.ScrollBarThickness = 6
  244. tabScrollingFrame.ScrollBarImageColor3 = Color3.fromRGB(80, 80, 100)
  245. local tabCorner = Instance.new("UICorner", tabScrollingFrame); tabCorner.CornerRadius = UDim.new(0, 4)
  246. local tabLayout = Instance.new("UIListLayout", tabScrollingFrame); tabLayout.FillDirection = Enum.FillDirection.Horizontal; tabLayout.Padding = UDim.new(0, 5)
  247. local tabPadding = Instance.new("UIPadding", tabScrollingFrame); tabPadding.PaddingLeft = UDim.new(0, 5)
  248.  
  249. local addTabButton = Instance.new("TextButton", tabContainer)
  250. addTabButton.Size = UDim2.new(0, 30, 0, 30)
  251. addTabButton.Position = UDim2.new(1, -30, 0.5, 0)
  252. addTabButton.AnchorPoint = Vector2.new(0, 0.5)
  253. addTabButton.BackgroundColor3 = Color3.fromRGB(50, 180, 80)
  254. addTabButton.Font = Enum.Font.SourceSansBold
  255. addTabButton.Text = "+"
  256. addTabButton.TextColor3 = Color3.new(1, 1, 1)
  257. addTabButton.TextSize = 20
  258. local addTabCorner = Instance.new("UICorner", addTabButton); addTabCorner.CornerRadius = UDim.new(0, 4)
  259.  
  260. local mainContentFrame = Instance.new("Frame", window.Container)
  261. mainContentFrame.Size = UDim2.new(1, 0, 1, -35)
  262. mainContentFrame.Position = UDim2.new(0, 0, 0, 35)
  263. mainContentFrame.BackgroundTransparency = 1
  264.  
  265. local mainPadding = Instance.new("UIPadding", mainContentFrame); mainPadding.PaddingLeft=UDim.new(0,10); mainPadding.PaddingRight=UDim.new(0,10); mainPadding.PaddingTop=UDim.new(0,10)
  266. local topControls = Instance.new("Frame", mainContentFrame); topControls.Size = UDim2.new(1, 0, 0, 30); topControls.BackgroundTransparency = 1
  267. local topControlsLayout = Instance.new("UIListLayout", topControls); topControlsLayout.FillDirection = Enum.FillDirection.Horizontal; topControlsLayout.VerticalAlignment = Enum.VerticalAlignment.Center; topControlsLayout.Padding = UDim.new(0, 10)
  268.  
  269. local addMessageButton = Instance.new("TextButton", topControls)
  270. addMessageButton.Name = "AddMessage"
  271. addMessageButton.LayoutOrder = 1
  272. addMessageButton.Size = UDim2.new(0, 30, 0, 26)
  273. addMessageButton.BackgroundColor3 = Color3.fromRGB(50, 180, 80)
  274. addMessageButton.Font = Enum.Font.SourceSansBold
  275. addMessageButton.Text = "+"
  276. addMessageButton.TextColor3 = Color3.new(1, 1, 1)
  277. addMessageButton.TextSize = 20
  278. local cAMB = Instance.new("UICorner", addMessageButton); cAMB.CornerRadius = UDim.new(0, 4)
  279.  
  280. local cooldownFrame = Instance.new("Frame", topControls); cooldownFrame.BackgroundTransparency = 1; cooldownFrame.LayoutOrder = 2; cooldownFrame.Size = UDim2.new(0, 130, 1, 0)
  281. local cooldownLabel = Instance.new("TextLabel", cooldownFrame); cooldownLabel.BackgroundTransparency = 1; cooldownLabel.Size = UDim2.new(0, 70, 1, 0); cooldownLabel.Font = Enum.Font.SourceSans; cooldownLabel.TextColor3 = Color3.fromRGB(200, 200, 200); cooldownLabel.TextSize = 14; cooldownLabel.Text = "Cooldown:"; cooldownLabel.TextXAlignment = Enum.TextXAlignment.Right
  282. local cooldownInput = Instance.new("TextBox", cooldownFrame); cooldownInput.Size = UDim2.new(0, 50, 1, -6); cooldownInput.Position = UDim2.new(0, 75, 0.5, 0); cooldownInput.AnchorPoint = Vector2.new(0, 0.5); cooldownInput.BackgroundColor3 = Color3.fromRGB(40, 40, 50); cooldownInput.Font = Enum.Font.SourceSans; cooldownInput.Text = tostring(state.cooldown); cooldownInput.PlaceholderText = tostring(Config.DefaultCooldown); cooldownInput.TextColor3 = Color3.fromRGB(220, 220, 220); cooldownInput.TextSize = 14; cooldownInput.ClearTextOnFocus = false
  283. local cCI = Instance.new("UICorner", cooldownInput); cCI.CornerRadius = UDim.new(0, 4)
  284. local hookButton = Instance.new("TextButton", topControls); hookButton.Name = "HookButton"; hookButton.LayoutOrder = 3; hookButton.Size = UDim2.new(0, 150, 0, 26); hookButton.BackgroundColor3 = Color3.fromRGB(210, 120, 0); hookButton.Font = Enum.Font.SourceSans; hookButton.Text = "Hook MessageID 🛰️"; hookButton.TextColor3 = Color3.new(1, 1, 1); hookButton.TextSize = 14
  285. local cH = Instance.new("UICorner", hookButton); cH.CornerRadius = UDim.new(0, 4)
  286. local scrollFrame = Instance.new("ScrollingFrame", mainContentFrame); scrollFrame.Size = UDim2.new(1, 0, 1, -80); scrollFrame.Position = UDim2.new(0, 0, 0, 40); scrollFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40); scrollFrame.BorderSizePixel = 0; scrollFrame.CanvasSize = UDim2.new(); scrollFrame.ScrollBarImageColor3 = Color3.fromRGB(80, 80, 100); scrollFrame.ScrollBarThickness = 6
  287. local cS = Instance.new("UICorner", scrollFrame); cS.CornerRadius = UDim.new(0, 4)
  288. local listLayout = Instance.new("UIListLayout", scrollFrame); listLayout.Padding = UDim.new(0, 5); listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center; listLayout.SortOrder = Enum.SortOrder.LayoutOrder
  289. local listPadding = Instance.new("UIPadding", scrollFrame); listPadding.PaddingTop = UDim.new(0, 5); listPadding.PaddingLeft = UDim.new(0, 5); listPadding.PaddingRight = UDim.new(0, 5)
  290. local runButton = Instance.new("TextButton", mainContentFrame); runButton.Name = "Run"; runButton.Size = UDim2.new(1, 0, 0, 30); runButton.Position = UDim2.new(0, 0, 1, -30); runButton.BackgroundColor3 = Color3.fromRGB(80, 120, 220); runButton.Font = Enum.Font.SourceSansBold; runButton.Text = "Run"; runButton.TextColor3 = Color3.new(1, 1, 1); runButton.TextSize = 16
  291. local cR = Instance.new("UICorner", runButton); cR.CornerRadius = UDim.new(0, 4)
  292.  
  293. function send_initial_message(m)
  294.     local success, result = pcall(function() return channel:SendAsync(m) end)
  295.     if success and result then
  296.         print(" - MessageId Hooked: " .. tostring(result.MessageId))
  297.         return result.MessageId
  298.     else
  299.         warn("Failed to send initial message:", result)
  300.         return nil
  301.     end
  302. end
  303.  
  304. function updateRunButtonText()
  305.     local count = 0
  306.     for _, entry in ipairs(messageEntries) do
  307.         if entry.selected then
  308.             count = count + 1
  309.         end
  310.     end
  311.     if count > 0 then
  312.         runButton.Text = "Run (" .. count .. ")"
  313.     else
  314.         runButton.Text = "Run"
  315.     end
  316. end
  317.  
  318. function runSequence(messages)
  319.     if state.isSequenceRunning or #messages == 0 or not state.messageId then return end
  320.     state.isSequenceRunning = true
  321.     runButton.Text = "Running..."
  322.     runButton.Active = false
  323.     task.spawn(function()
  324.         for _, msg in ipairs(messages) do
  325.             pcall(replicatesignal, signal, msg, "b", state.messageId, speaker, channel)
  326.             task.wait(state.cooldown)
  327.         end
  328.         state.isSequenceRunning = false
  329.         runButton.Active = true
  330.         updateRunButtonText()
  331.     end)
  332. end
  333.  
  334. function createMessageEntry(text)
  335.     local entryFrame = Instance.new("Frame", scrollFrame)
  336.     entryFrame.Name = "MessageEntry"
  337.     entryFrame.LayoutOrder = #messageEntries + 1
  338.     entryFrame.Size = UDim2.new(1, 0, 0, 35)
  339.     entryFrame.BackgroundColor3 = Color3.fromRGB(55, 55, 65)
  340.     entryFrame.BorderSizePixel = 0
  341.     local cornerEntry = Instance.new("UICorner", entryFrame)
  342.     cornerEntry.CornerRadius = UDim.new(0, 4)
  343.  
  344.     local checkBox = Instance.new("TextButton", entryFrame)
  345.     checkBox.Size = UDim2.new(0, 20, 0, 20)
  346.     checkBox.Position = UDim2.new(0, 8, 0.5, -10)
  347.     checkBox.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
  348.     checkBox.Text = ""
  349.     local cornerCheck = Instance.new("UICorner", checkBox)
  350.     cornerCheck.CornerRadius = UDim.new(0, 4)
  351.  
  352.     local textBox = Instance.new("TextBox", entryFrame)
  353.     textBox.Size = UDim2.new(1, -100, 1, -10)
  354.     textBox.Position = UDim2.new(0, 35, 0.5, 0)
  355.     textBox.AnchorPoint = Vector2.new(0, 0.5)
  356.     textBox.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
  357.     textBox.Font = Enum.Font.SourceSans
  358.     textBox.Text = text or ""
  359.     textBox.TextColor3 = Color3.fromRGB(220, 220, 220)
  360.     textBox.TextSize = 14
  361.     textBox.ClearTextOnFocus = false
  362.     local cornerBox = Instance.new("UICorner", textBox)
  363.     cornerBox.CornerRadius = UDim.new(0, 4)
  364.  
  365.     local sendButton = Instance.new("TextButton", entryFrame)
  366.     sendButton.Size = UDim2.new(0, 25, 0, 25)
  367.     sendButton.Position = UDim2.new(1, -60, 0.5, 0)
  368.     sendButton.AnchorPoint = Vector2.new(0, 0.5)
  369.     sendButton.BackgroundColor3 = Color3.fromRGB(60, 160, 80)
  370.     sendButton.Font = Enum.Font.SourceSansBold
  371.     sendButton.Text = "▶"
  372.     sendButton.TextColor3 = Color3.new(1, 1, 1)
  373.     sendButton.TextSize = 16
  374.     local cornerSend = Instance.new("UICorner", sendButton)
  375.     cornerSend.CornerRadius = UDim.new(0, 4)
  376.  
  377.     local deleteButton = Instance.new("TextButton", entryFrame)
  378.     deleteButton.Size = UDim2.new(0, 25, 0, 25)
  379.     deleteButton.Position = UDim2.new(1, -30, 0.5, 0)
  380.     deleteButton.AnchorPoint = Vector2.new(0, 0.5)
  381.     deleteButton.BackgroundColor3 = Color3.fromRGB(200, 60, 60)
  382.     deleteButton.Font = Enum.Font.SourceSansBold
  383.     deleteButton.Text = "-"
  384.     deleteButton.TextColor3 = Color3.new(1, 1, 1)
  385.     deleteButton.TextSize = 20
  386.     local cornerDel = Instance.new("UICorner", deleteButton)
  387.     cornerDel.CornerRadius = UDim.new(0, 4)
  388.  
  389.     local entryData = { frame = entryFrame, checkbox = checkBox, textbox = textBox, selected = false }
  390.     table.insert(messageEntries, entryData)
  391.  
  392.     checkBox.MouseButton1Click:Connect(function()
  393.         entryData.selected = not entryData.selected
  394.         checkBox.Text = entryData.selected and "✓" or ""
  395.         checkBox.BackgroundColor3 = entryData.selected and Color3.fromRGB(80, 120, 220) or Color3.fromRGB(40, 40, 50)
  396.         updateRunButtonText()
  397.     end)
  398.     sendButton.MouseButton1Click:Connect(function() runSequence({ textBox.Text }) end)
  399.     deleteButton.MouseButton1Click:Connect(function()
  400.         for i, entry in ipairs(messageEntries) do
  401.             if entry.frame == entryFrame then
  402.                 table.remove(messageEntries, i)
  403.                 break
  404.             end
  405.         end
  406.         entryFrame:Destroy()
  407.         updateRunButtonText()
  408.         saveCurrentTabData()
  409.     end)
  410.     textBox.FocusLost:Connect(function() saveCurrentTabData() end)
  411. end
  412.  
  413. function switchTab(tabIndex)
  414.     if not state.tabs[tabIndex] then return end
  415.     if tabButtons[state.activeTabIndex] then
  416.         tabButtons[state.activeTabIndex].BackgroundColor3 = Color3.fromRGB(45, 45, 55)
  417.     end
  418.     if tabButtons[tabIndex] then
  419.         tabButtons[tabIndex].BackgroundColor3 = Color3.fromRGB(65, 65, 75)
  420.     end
  421.     state.activeTabIndex = tabIndex
  422.     for _, entry in ipairs(messageEntries) do
  423.         entry.frame:Destroy()
  424.     end
  425.     messageEntries = {}
  426.     local filePath = Config.SaveFolder .. "/" .. state.tabs[tabIndex].file
  427.     if isfile and isfile(filePath) then
  428.         local success, content = pcall(readfile, filePath)
  429.         if success and content then
  430.             local success2, data = pcall(HttpService.JSONDecode, HttpService, content)
  431.             if success2 and type(data) == "table" then
  432.                 for _, msgText in ipairs(data) do
  433.                     createMessageEntry(msgText)
  434.                 end
  435.             end
  436.         end
  437.     end
  438.     updateRunButtonText()
  439.     saveGlobalConfig()
  440. end
  441.  
  442. function deleteTab(indexToDelete)
  443.     if #state.tabs <= 1 then return end
  444.  
  445.     local tabInfo = state.tabs[indexToDelete]
  446.     local buttonToDelete = tabButtons[indexToDelete]
  447.  
  448.     if delfile then
  449.         delfile(Config.SaveFolder .. "/" .. tabInfo.file)
  450.     end
  451.     buttonToDelete:Destroy()
  452.     table.remove(state.tabs, indexToDelete)
  453.     table.remove(tabButtons, indexToDelete)
  454.  
  455.     for i = indexToDelete, #state.tabs do
  456.         local tabToUpdate = state.tabs[i]
  457.         local buttonToUpdate = tabButtons[i]
  458.         local oldFilePath = Config.SaveFolder .. "/" .. tabToUpdate.file
  459.        
  460.         local newName = "Tab " .. i
  461.         local newFileName = "Tab_" .. i .. ".json"
  462.         local newFilePath = Config.SaveFolder .. "/" .. newFileName
  463.        
  464.         if renamefile then
  465.             pcall(renamefile, oldFilePath, newFilePath)
  466.         else
  467.             local success, content = pcall(readfile, oldFilePath)
  468.             if success and content then
  469.                 writefile(newFilePath, content)
  470.                 delfile(oldFilePath)
  471.             end
  472.         end
  473.  
  474.         tabToUpdate.name = newName
  475.         tabToUpdate.file = newFileName
  476.         buttonToUpdate.Text = newName
  477.         buttonToUpdate.Name = tostring(i)
  478.     end
  479.  
  480.     local newActiveIndex = state.activeTabIndex
  481.     if indexToDelete == state.activeTabIndex then
  482.         newActiveIndex = math.max(1, indexToDelete - 1)
  483.     elseif indexToDelete < state.activeTabIndex then
  484.         newActiveIndex = state.activeTabIndex - 1
  485.     end
  486.     switchTab(newActiveIndex)
  487. end
  488.  
  489. function createTabButton(tabInfo, index)
  490.     local button = Instance.new("TextButton", tabScrollingFrame)
  491.     button.Name = tostring(index)
  492.     button.Size = UDim2.new(0, 100, 1, 0)
  493.     button.BackgroundColor3 = Color3.fromRGB(45, 45, 55)
  494.     button.Font = Enum.Font.SourceSans
  495.     button.Text = tabInfo.name
  496.     button.TextColor3 = Color3.new(1, 1, 1)
  497.     button.TextSize = 14
  498.     local corner = Instance.new("UICorner", button)
  499.     corner.CornerRadius = UDim.new(0, 4)
  500.  
  501.     local closeButton = Instance.new("TextButton", button)
  502.     closeButton.Size = UDim2.new(0, 15, 0, 15)
  503.     closeButton.Position = UDim2.new(1, -10, 0.5, 0)
  504.     closeButton.AnchorPoint = Vector2.new(0.5, 0.5)
  505.     closeButton.BackgroundTransparency = 1
  506.     closeButton.Font = Enum.Font.SourceSansBold
  507.     closeButton.Text = "x"
  508.     closeButton.TextColor3 = Color3.fromRGB(180, 180, 180)
  509.     closeButton.TextSize = 14
  510.  
  511.     button.MouseButton1Click:Connect(function()
  512.         switchTab(index)
  513.     end)
  514.     closeButton.MouseButton1Click:Connect(function()
  515.         deleteTab(index)
  516.     end)
  517.    
  518.     table.insert(tabButtons, index, button)
  519. end
  520.  
  521. function addTab()
  522.     local newIndex = #state.tabs + 1
  523.     local newTab = { name = "Tab " .. newIndex, file = "Tab_" .. newIndex .. ".json" }
  524.     table.insert(state.tabs, newTab)
  525.  
  526.     local success, encoded = pcall(HttpService.JSONEncode, HttpService, { "New Message" })
  527.     if success then
  528.         makefolder(Config.SaveFolder)
  529.         writefile(Config.SaveFolder .. "/" .. newTab.file, encoded)
  530.     end
  531.    
  532.     createTabButton(newTab, newIndex)
  533.     switchTab(newIndex)
  534. end
  535.  
  536. addMessageButton.MouseButton1Click:Connect(function() createMessageEntry("New Message"); saveCurrentTabData() end)
  537. cooldownInput.FocusLost:Connect(function(e)if e then local n=tonumber(cooldownInput.Text);if n and n>=0 then state.cooldown=n;saveGlobalConfig()else cooldownInput.Text=tostring(state.cooldown)end end end)
  538. runButton.MouseButton1Click:Connect(function()local m={};for _,e in ipairs(messageEntries)do if e.selected then table.insert(m,e.textbox.Text)end end;runSequence(m)end)
  539. addTabButton.MouseButton1Click:Connect(addTab)
  540.  
  541. function createCheckbox(text)
  542.     local frame = Instance.new("Frame", window.SettingsContainer)
  543.     frame.Size = UDim2.new(1, 0, 0, 25)
  544.     frame.BackgroundTransparency = 1
  545.     local label = Instance.new("TextLabel", frame)
  546.     label.Size = UDim2.new(1, -30, 1, 0)
  547.     label.BackgroundTransparency = 1
  548.     label.Font = Enum.Font.SourceSans
  549.     label.TextColor3 = Color3.fromRGB(220, 220, 220)
  550.     label.Text = text
  551.     label.TextSize = 15
  552.     label.TextXAlignment = Enum.TextXAlignment.Left
  553.     local checkBox = Instance.new("TextButton", frame)
  554.     checkBox.Size = UDim2.new(0, 20, 0, 20)
  555.     checkBox.Position = UDim2.new(1, -20, 0.5, 0)
  556.     checkBox.AnchorPoint = Vector2.new(0.5, 0.5)
  557.     checkBox.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
  558.     checkBox.Text = ""
  559.     local corner = Instance.new("UICorner", checkBox)
  560.     corner.CornerRadius = UDim.new(0, 4)
  561.     local value = false
  562.     local api = {}
  563.     local changedEvent = Instance.new("BindableEvent")
  564.     api.Changed = changedEvent.Event
  565.     function api:SetValue(newValue)
  566.         value = newValue
  567.         checkBox.BackgroundColor3 = value and Color3.fromRGB(80, 120, 220) or Color3.fromRGB(40, 40, 50)
  568.         changedEvent:Fire(value)
  569.     end
  570.     checkBox.MouseButton1Click:Connect(function()
  571.         api:SetValue(not value)
  572.     end)
  573.     return api
  574. end
  575.  
  576. function createSlider(text)
  577.     local frame = Instance.new("Frame", window.SettingsContainer)
  578.     frame.Size = UDim2.new(1, 0, 0, 40)
  579.     frame.BackgroundTransparency = 1
  580.     local label = Instance.new("TextLabel", frame)
  581.     label.Size = UDim2.new(1, 0, 0.5, 0)
  582.     label.BackgroundTransparency = 1
  583.     label.Font = Enum.Font.SourceSans
  584.     label.TextColor3 = Color3.fromRGB(220, 220, 220)
  585.     label.Text = text
  586.     label.TextSize = 15
  587.     label.TextXAlignment = Enum.TextXAlignment.Left
  588.     local sliderBar = Instance.new("Frame", frame)
  589.     sliderBar.Size = UDim2.new(1, 0, 0, 6)
  590.     sliderBar.Position = UDim2.new(0, 0, 0.5, 0)
  591.     sliderBar.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
  592.     local corner = Instance.new("UICorner", sliderBar)
  593.     corner.CornerRadius = UDim.new(0, 3)
  594.     local fillBar = Instance.new("Frame", sliderBar)
  595.     fillBar.Size = UDim2.new(0, 0, 1, 0)
  596.     fillBar.BackgroundColor3 = Color3.fromRGB(80, 120, 220)
  597.     local cornerFill = Instance.new("UICorner", fillBar)
  598.     cornerFill.CornerRadius = UDim.new(0, 3)
  599.     local handle = Instance.new("TextButton", sliderBar)
  600.     handle.Size = UDim2.new(0, 16, 0, 16)
  601.     handle.Position = UDim2.new(0, 0, 0.5, 0)
  602.     handle.AnchorPoint = Vector2.new(0.5, 0.5)
  603.     handle.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
  604.     handle.BorderSizePixel = 0
  605.     local cornerHandle = Instance.new("UICorner", handle)
  606.     cornerHandle.CornerRadius = UDim.new(1, 0)
  607.     local value = 0
  608.     local api = {}
  609.     local changedEvent = Instance.new("BindableEvent")
  610.     api.Changed = changedEvent.Event
  611.     function api:SetValue(newValue)
  612.         value = math.clamp(newValue, 0, 1)
  613.         handle.Position = UDim2.new(value, 0, 0.5, 0)
  614.         fillBar.Size = UDim2.new(value, 0, 1, 0)
  615.         changedEvent:Fire(value)
  616.     end
  617.     local function updateFromInput(input)
  618.         api:SetValue((input.Position.X - sliderBar.AbsolutePosition.X) / sliderBar.AbsoluteSize.X)
  619.     end
  620.     sliderBar.InputBegan:Connect(function(input)
  621.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  622.             updateFromInput(input)
  623.         end
  624.     end)
  625.     handle.InputBegan:Connect(function(input)
  626.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  627.             local moveConnection, endConnection
  628.             moveConnection = UserInputService.InputChanged:Connect(function(moveInput)
  629.                 if moveInput.UserInputType == Enum.UserInputType.MouseMovement then
  630.                     updateFromInput(moveInput)
  631.                 end
  632.             end)
  633.             endConnection = UserInputService.InputEnded:Connect(function(endInput)
  634.                 if endInput.UserInputType == Enum.UserInputType.MouseButton1 then
  635.                     moveConnection:Disconnect()
  636.                     endConnection:Disconnect()
  637.                 end
  638.             end)
  639.         end
  640.     end)
  641.     return api
  642. end
  643.  
  644. function createTextInput(text, placeholder)
  645.     local frame = Instance.new("Frame", window.SettingsContainer)
  646.     frame.Size = UDim2.new(1, 0, 0, 25)
  647.     frame.BackgroundTransparency = 1
  648.     local label = Instance.new("TextLabel", frame)
  649.     label.Size = UDim2.new(0, 110, 1, 0)
  650.     label.BackgroundTransparency = 1
  651.     label.Font = Enum.Font.SourceSans
  652.     label.TextColor3 = Color3.fromRGB(220, 220, 220)
  653.     label.Text = text
  654.     label.TextSize = 15
  655.     label.TextXAlignment = Enum.TextXAlignment.Left
  656.     local textBox = Instance.new("TextBox", frame)
  657.     textBox.Size = UDim2.new(1, -120, 1, 0)
  658.     textBox.Position = UDim2.new(0, 110, 0, 0)
  659.     textBox.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
  660.     textBox.Font = Enum.Font.SourceSans
  661.     textBox.Text = tostring(state.cacheMessage)
  662.     textBox.PlaceholderText = placeholder or ""
  663.     textBox.TextColor3 = Color3.fromRGB(220, 220, 220)
  664.     textBox.TextSize = 14
  665.     textBox.ClearTextOnFocus = false
  666.     local corner = Instance.new("UICorner", textBox)
  667.     corner.CornerRadius = UDim.new(0, 4)
  668.     textBox.FocusLost:Connect(function(enterPressed)
  669.         if enterPressed then
  670.             state.cacheMessage = textBox.Text
  671.             saveGlobalConfig()
  672.         end
  673.     end)
  674.     return textBox
  675. end
  676.  
  677. shadowCheckbox = createCheckbox("Enable Shadow")
  678. transparencySlider = createSlider("Transparency")
  679. cacheInput = createTextInput("Default Cache:", Config.DefaultCacheMessage)
  680.  
  681. shadowCheckbox.Changed:Connect(function(v) window.Shadow.Visible = v; state.globalSettings.shadow = v; saveGlobalConfig() end)
  682. transparencySlider.Changed:Connect(function(v) local t=v*0.7;local m=window.MainWindow;m.BackgroundTransparency,m.TopBar.BackgroundTransparency,m.TopBar.CloseButton.BackgroundTransparency,m.TopBar.SettingsButton.BackgroundTransparency=t,t,t,t;state.globalSettings.transparency=v;saveGlobalConfig()end)
  683. hookButton.MouseButton1Click:Connect(function()print("Re-hooking MessageID...");local n=send_initial_message(state.cacheMessage)if n then state.messageId=n else runButton.Text="Re-hook Failed";runButton.BackgroundColor3=Color3.fromRGB(200,60,60);runButton.Active=false end end)
  684.  
  685. if makefolder and isfolder and writefile and isfile and HttpService then
  686.     pcall(function()
  687.         function saveGlobalConfig()
  688.             local data = {cooldown = state.cooldown, cacheMessage = state.cacheMessage, globalSettings = state.globalSettings, tabs = state.tabs, activeTabIndex = state.activeTabIndex}
  689.             local success, encoded = pcall(HttpService.JSONEncode, HttpService, data)
  690.             if success then
  691.                 makefolder(Config.SaveFolder)
  692.                 writefile(Config.SaveFolder .. "/" .. Config.GlobalConfigFile, encoded)
  693.             end
  694.         end
  695.         function saveCurrentTabData()
  696.             local messages = {}
  697.             for _, entry in ipairs(messageEntries) do
  698.                 table.insert(messages, entry.textbox.Text)
  699.             end
  700.             if not state.tabs[state.activeTabIndex] then return end
  701.             local filePath = Config.SaveFolder .. "/" .. state.tabs[state.activeTabIndex].file
  702.             local success, encoded = pcall(HttpService.JSONEncode, HttpService, messages)
  703.             if success then
  704.                 makefolder(Config.SaveFolder)
  705.                 writefile(filePath, encoded)
  706.             end
  707.         end
  708.         function loadSettings()
  709.             local filePath = Config.SaveFolder .. "/" .. Config.GlobalConfigFile
  710.             if not isfile(filePath) then return end
  711.             local success, content = pcall(readfile, filePath)
  712.             if not success or not content then return end
  713.             local decodedSuccess, data = pcall(HttpService.JSONDecode, HttpService, content)
  714.             if not decodedSuccess or type(data) ~= "table" then return end
  715.             if type(data.cooldown) == "number" then state.cooldown = data.cooldown; cooldownInput.Text = tostring(state.cooldown) end
  716.             if type(data.cacheMessage) == "string" then state.cacheMessage = data.cacheMessage; cacheInput.Text = state.cacheMessage end
  717.             if type(data.globalSettings) == "table" then state.globalSettings = data.globalSettings; transparencySlider:SetValue(state.globalSettings.transparency or 0); shadowCheckbox:SetValue(state.globalSettings.shadow or false) end
  718.             if type(data.tabs) == "table" and #data.tabs > 0 then state.tabs = data.tabs else state.tabs = {{name = "Tab 1", file = "Tab_1.json"}} end
  719.             state.activeTabIndex = data.activeTabIndex or 1
  720.             if state.activeTabIndex > #state.tabs then state.activeTabIndex = 1 end
  721.             for i, tabInfo in ipairs(state.tabs) do createTabButton(tabInfo, i) end
  722.             switchTab(state.activeTabIndex)
  723.         end
  724.         loadSettings()
  725.     end)
  726. end
  727.  
  728. if #state.tabs == 0 then addTab() end
  729.  
  730. RunService.RenderStepped:Connect(function()
  731.     scrollFrame.CanvasSize = UDim2.new(0, 0, 0, listLayout.AbsoluteContentSize.Y)
  732.     tabScrollingFrame.CanvasSize = UDim2.new(0, tabLayout.AbsoluteContentSize.X, 0, 0)
  733. end)
  734.  
  735. if not replicatesignal then
  736.     runButton.Text, runButton.BackgroundColor3, runButton.Active = "Error: 'replicatesignal' not found", Color3.fromRGB(200, 60, 60), false
  737. else
  738.     state.messageId = send_initial_message(state.cacheMessage)
  739.     if not state.messageId then
  740.         runButton.Text, runButton.BackgroundColor3, runButton.Active = "Error: Could not get MessageId", Color3.fromRGB(200, 60, 60), false
  741.     end
  742. end
Advertisement
Add Comment
Please, Sign In to add comment