Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Chat-Editor ✒️
- .Message from agent666_0.
- Farhat#9879: I used Ai because...
- I'm not good at Gui making stuff
- but some parts i taked from Infinite yield
- and i found that signal that edites messages
- --]]
- local function missing(t, f, fallback)
- if type(f) == t then
- return f
- end
- return fallback
- end
- local waxwritefile, waxreadfile = writefile, readfile
- writefile = missing("function", waxwritefile) and function(file, data, safe)
- if safe == true then
- return pcall(waxwritefile, file, data)
- end
- waxwritefile(file, data)
- end
- readfile = missing("function", waxreadfile) and function(file, safe)
- if safe == true then
- return pcall(waxreadfile, file)
- end
- return waxreadfile(file)
- end
- isfile = missing("function", isfile, readfile and function(file)
- local success, result = pcall(function() return readfile(file) end)
- return success and result ~= nil and result ~= ""
- end)
- makefolder = missing("function", makefolder)
- isfolder = missing("function", isfolder)
- delfile = missing("function", delfile)
- renamefile = missing("function", appendfile)
- local Config = {
- WindowTitle = "Chat-Editor ✒️",
- DefaultCooldown = 5,
- DefaultCacheMessage = ".",
- UniqueGuiName = "ChatEditorScreenGui",
- SaveFolder = "ChatEditor",
- GlobalConfigFile = "Config.json"
- }
- local library = {}
- local function makeDraggable(topbar, window, UserInputService)
- local isDragging = false
- local dragStart, startPos, moveConnection, upConnection
- topbar.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- isDragging = true
- dragStart = input.Position
- startPos = window.Position
- moveConnection = UserInputService.InputChanged:Connect(function(moveInput)
- if isDragging and (moveInput.UserInputType == Enum.UserInputType.MouseMovement or moveInput.UserInputType == Enum.UserInputType.Touch) then
- local delta = moveInput.Position - dragStart
- window.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end)
- upConnection = UserInputService.InputEnded:Connect(function(upInput)
- if upInput.UserInputType == Enum.UserInputType.MouseButton1 or upInput.UserInputType == Enum.UserInputType.Touch then
- isDragging = false
- if moveConnection then moveConnection:Disconnect() end
- if upConnection then upConnection:Disconnect() end
- end
- end)
- end
- end)
- end
- function library:CreateWindow(title, parent, UserInputService)
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = Config.UniqueGuiName
- screenGui.DisplayOrder = 999
- screenGui.ResetOnSpawn = false
- screenGui.IgnoreGuiInset = true
- screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- local mainFrame = Instance.new("Frame", screenGui)
- mainFrame.Name = "MainWindow"
- mainFrame.Size = UDim2.new(0, 450, 0, 380)
- mainFrame.Position = UDim2.new(0.5, -225, 0.5, -190)
- mainFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 45)
- mainFrame.BorderColor3 = Color3.fromRGB(80, 80, 100)
- mainFrame.BorderSizePixel = 1
- mainFrame.ClipsDescendants = true
- local uiCorner = Instance.new("UICorner", mainFrame)
- uiCorner.CornerRadius = UDim.new(0, 6)
- local shadow = Instance.new("ImageLabel", mainFrame)
- shadow.Name = "Shadow"
- shadow.BackgroundTransparency = 1
- shadow.Image = "rbxassetid://12489812400"
- shadow.ImageColor3 = Color3.new(0, 0, 0)
- shadow.ImageTransparency = 0.5
- shadow.ScaleType = Enum.ScaleType.Slice
- shadow.SliceCenter = Rect.new(20, 20, 280, 280)
- shadow.Size = UDim2.new(1, 10, 1, 10)
- shadow.Position = UDim2.new(0.5, 0, 0.5, 0)
- shadow.AnchorPoint = Vector2.new(0.5, 0.5)
- shadow.ZIndex = -1
- shadow.Visible = false
- local topBar = Instance.new("Frame", mainFrame)
- topBar.Name = "TopBar"
- topBar.Size = UDim2.new(1, 0, 0, 30)
- topBar.BackgroundColor3 = Color3.fromRGB(45, 45, 55)
- topBar.BorderSizePixel = 0
- local titleLabel = Instance.new("TextLabel", topBar)
- titleLabel.Name = "Title"
- titleLabel.Size = UDim2.new(1, -60, 1, 0)
- titleLabel.Position = UDim2.new(0, 5, 0, 0)
- titleLabel.BackgroundTransparency = 1
- titleLabel.Font = Enum.Font.SourceSans
- titleLabel.TextColor3 = Color3.fromRGB(220, 220, 220)
- titleLabel.Text = title or "Window"
- titleLabel.TextSize = 16
- titleLabel.TextXAlignment = Enum.TextXAlignment.Left
- local closeButton = Instance.new("TextButton", topBar)
- closeButton.Name = "CloseButton"
- closeButton.Size = UDim2.new(0, 30, 1, 0)
- closeButton.Position = UDim2.new(1, -30, 0, 0)
- closeButton.BackgroundColor3 = topBar.BackgroundColor3
- closeButton.Font = Enum.Font.SourceSansBold
- closeButton.TextColor3 = Color3.fromRGB(220, 220, 220)
- closeButton.Text = "X"
- closeButton.TextSize = 16
- closeButton.BorderSizePixel = 0
- closeButton.MouseButton1Click:Connect(function() screenGui:Destroy() end)
- local settingsButton = Instance.new("TextButton", topBar)
- settingsButton.Name = "SettingsButton"
- settingsButton.Size = UDim2.new(0, 30, 1, 0)
- settingsButton.Position = UDim2.new(1, -60, 0, 0)
- settingsButton.BackgroundColor3 = topBar.BackgroundColor3
- settingsButton.Font = Enum.Font.SourceSans
- settingsButton.TextColor3 = Color3.fromRGB(220, 220, 220)
- settingsButton.Text = "⚙️"
- settingsButton.TextSize = 16
- settingsButton.BorderSizePixel = 0
- local contentFrame = Instance.new("Frame", mainFrame)
- contentFrame.Name = "Content"
- contentFrame.Size = UDim2.new(1, 0, 1, -30)
- contentFrame.Position = UDim2.new(0, 0, 0, 30)
- contentFrame.BackgroundTransparency = 1
- contentFrame.BorderSizePixel = 0
- local settingsFrame = Instance.new("Frame", mainFrame)
- settingsFrame.Name = "Settings"
- settingsFrame.Size = UDim2.new(1, 0, 1, -30)
- settingsFrame.Position = UDim2.new(0, 0, 0, 30)
- settingsFrame.BackgroundColor3 = mainFrame.BackgroundColor3
- settingsFrame.BorderSizePixel = 0
- settingsFrame.Visible = false
- local settingsListLayout = Instance.new("UIListLayout", settingsFrame)
- settingsListLayout.Padding = UDim.new(0, 10)
- settingsListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- settingsListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- local settingsPadding = Instance.new("UIPadding", settingsFrame)
- settingsPadding.PaddingTop = UDim.new(0, 15)
- settingsPadding.PaddingLeft = UDim.new(0, 15)
- settingsPadding.PaddingRight = UDim.new(0, 15)
- settingsButton.MouseButton1Click:Connect(function() settingsFrame.Visible = not settingsFrame.Visible end)
- makeDraggable(topBar, mainFrame, UserInputService)
- screenGui.Parent = parent
- return { Root = screenGui, Container = contentFrame, SettingsContainer = settingsFrame, MainWindow = mainFrame, Shadow = shadow }
- end
- local cloneref = missing("function", cloneref, function(...) return ... end)
- local replicatesignal = missing("function", replicatesignal)
- local Services = setmetatable({}, {
- __index = function(self, name)
- local success, cache = pcall(function() return cloneref(game:GetService(name)) end)
- if success then
- rawset(self, name, cache)
- return cache
- else
- error("Invalid Roblox Service: " .. tostring(name))
- end
- end
- })
- local Players = Services.Players
- local TextChatService = Services.TextChatService
- local CoreGui = Services.CoreGui
- local RunService = Services.RunService
- local UserInputService = Services.UserInputService
- local HttpService = Services.HttpService
- if CoreGui:FindFirstChild(Config.UniqueGuiName) then CoreGui[Config.UniqueGuiName]:Destroy(); print("Chat-Editor: Removed an old instance.") end
- local player = Players.LocalPlayer
- local channel = TextChatService.TextChannels.RBXGeneral
- local speaker = channel:WaitForChild(player.Name)
- local signal = TextChatService.ClientToServerMessageReplicateSignalV2
- local state = {
- messageId = nil,
- cooldown = Config.DefaultCooldown,
- cacheMessage = Config.DefaultCacheMessage,
- isSequenceRunning = false,
- globalSettings = { transparency = 0, shadow = false },
- tabs = {},
- activeTabIndex = 1
- }
- local window = library:CreateWindow(Config.WindowTitle, CoreGui, UserInputService)
- local messageEntries = {}
- local tabButtons = {}
- local createMessageEntry, saveGlobalConfig, saveCurrentTabData
- local shadowCheckbox, transparencySlider, cacheInput
- local createTabButton, switchTab, addTab, deleteTab
- local tabContainer = Instance.new("Frame", window.Container)
- tabContainer.Size = UDim2.new(1, 0, 0, 35)
- tabContainer.BackgroundTransparency = 1
- local tabScrollingFrame = Instance.new("ScrollingFrame", tabContainer)
- tabScrollingFrame.Size = UDim2.new(1, -35, 1, 0)
- tabScrollingFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
- tabScrollingFrame.BorderSizePixel = 0
- tabScrollingFrame.CanvasSize = UDim2.new()
- tabScrollingFrame.ScrollBarThickness = 6
- tabScrollingFrame.ScrollBarImageColor3 = Color3.fromRGB(80, 80, 100)
- local tabCorner = Instance.new("UICorner", tabScrollingFrame); tabCorner.CornerRadius = UDim.new(0, 4)
- local tabLayout = Instance.new("UIListLayout", tabScrollingFrame); tabLayout.FillDirection = Enum.FillDirection.Horizontal; tabLayout.Padding = UDim.new(0, 5)
- local tabPadding = Instance.new("UIPadding", tabScrollingFrame); tabPadding.PaddingLeft = UDim.new(0, 5)
- local addTabButton = Instance.new("TextButton", tabContainer)
- addTabButton.Size = UDim2.new(0, 30, 0, 30)
- addTabButton.Position = UDim2.new(1, -30, 0.5, 0)
- addTabButton.AnchorPoint = Vector2.new(0, 0.5)
- addTabButton.BackgroundColor3 = Color3.fromRGB(50, 180, 80)
- addTabButton.Font = Enum.Font.SourceSansBold
- addTabButton.Text = "+"
- addTabButton.TextColor3 = Color3.new(1, 1, 1)
- addTabButton.TextSize = 20
- local addTabCorner = Instance.new("UICorner", addTabButton); addTabCorner.CornerRadius = UDim.new(0, 4)
- local mainContentFrame = Instance.new("Frame", window.Container)
- mainContentFrame.Size = UDim2.new(1, 0, 1, -35)
- mainContentFrame.Position = UDim2.new(0, 0, 0, 35)
- mainContentFrame.BackgroundTransparency = 1
- local mainPadding = Instance.new("UIPadding", mainContentFrame); mainPadding.PaddingLeft=UDim.new(0,10); mainPadding.PaddingRight=UDim.new(0,10); mainPadding.PaddingTop=UDim.new(0,10)
- local topControls = Instance.new("Frame", mainContentFrame); topControls.Size = UDim2.new(1, 0, 0, 30); topControls.BackgroundTransparency = 1
- local topControlsLayout = Instance.new("UIListLayout", topControls); topControlsLayout.FillDirection = Enum.FillDirection.Horizontal; topControlsLayout.VerticalAlignment = Enum.VerticalAlignment.Center; topControlsLayout.Padding = UDim.new(0, 10)
- local addMessageButton = Instance.new("TextButton", topControls)
- addMessageButton.Name = "AddMessage"
- addMessageButton.LayoutOrder = 1
- addMessageButton.Size = UDim2.new(0, 30, 0, 26)
- addMessageButton.BackgroundColor3 = Color3.fromRGB(50, 180, 80)
- addMessageButton.Font = Enum.Font.SourceSansBold
- addMessageButton.Text = "+"
- addMessageButton.TextColor3 = Color3.new(1, 1, 1)
- addMessageButton.TextSize = 20
- local cAMB = Instance.new("UICorner", addMessageButton); cAMB.CornerRadius = UDim.new(0, 4)
- local cooldownFrame = Instance.new("Frame", topControls); cooldownFrame.BackgroundTransparency = 1; cooldownFrame.LayoutOrder = 2; cooldownFrame.Size = UDim2.new(0, 130, 1, 0)
- 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
- 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
- local cCI = Instance.new("UICorner", cooldownInput); cCI.CornerRadius = UDim.new(0, 4)
- 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
- local cH = Instance.new("UICorner", hookButton); cH.CornerRadius = UDim.new(0, 4)
- 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
- local cS = Instance.new("UICorner", scrollFrame); cS.CornerRadius = UDim.new(0, 4)
- local listLayout = Instance.new("UIListLayout", scrollFrame); listLayout.Padding = UDim.new(0, 5); listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center; listLayout.SortOrder = Enum.SortOrder.LayoutOrder
- local listPadding = Instance.new("UIPadding", scrollFrame); listPadding.PaddingTop = UDim.new(0, 5); listPadding.PaddingLeft = UDim.new(0, 5); listPadding.PaddingRight = UDim.new(0, 5)
- 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
- local cR = Instance.new("UICorner", runButton); cR.CornerRadius = UDim.new(0, 4)
- function send_initial_message(m)
- local success, result = pcall(function() return channel:SendAsync(m) end)
- if success and result then
- print(" - MessageId Hooked: " .. tostring(result.MessageId))
- return result.MessageId
- else
- warn("Failed to send initial message:", result)
- return nil
- end
- end
- function updateRunButtonText()
- local count = 0
- for _, entry in ipairs(messageEntries) do
- if entry.selected then
- count = count + 1
- end
- end
- if count > 0 then
- runButton.Text = "Run (" .. count .. ")"
- else
- runButton.Text = "Run"
- end
- end
- function runSequence(messages)
- if state.isSequenceRunning or #messages == 0 or not state.messageId then return end
- state.isSequenceRunning = true
- runButton.Text = "Running..."
- runButton.Active = false
- task.spawn(function()
- for _, msg in ipairs(messages) do
- pcall(replicatesignal, signal, msg, "b", state.messageId, speaker, channel)
- task.wait(state.cooldown)
- end
- state.isSequenceRunning = false
- runButton.Active = true
- updateRunButtonText()
- end)
- end
- function createMessageEntry(text)
- local entryFrame = Instance.new("Frame", scrollFrame)
- entryFrame.Name = "MessageEntry"
- entryFrame.LayoutOrder = #messageEntries + 1
- entryFrame.Size = UDim2.new(1, 0, 0, 35)
- entryFrame.BackgroundColor3 = Color3.fromRGB(55, 55, 65)
- entryFrame.BorderSizePixel = 0
- local cornerEntry = Instance.new("UICorner", entryFrame)
- cornerEntry.CornerRadius = UDim.new(0, 4)
- local checkBox = Instance.new("TextButton", entryFrame)
- checkBox.Size = UDim2.new(0, 20, 0, 20)
- checkBox.Position = UDim2.new(0, 8, 0.5, -10)
- checkBox.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
- checkBox.Text = ""
- local cornerCheck = Instance.new("UICorner", checkBox)
- cornerCheck.CornerRadius = UDim.new(0, 4)
- local textBox = Instance.new("TextBox", entryFrame)
- textBox.Size = UDim2.new(1, -100, 1, -10)
- textBox.Position = UDim2.new(0, 35, 0.5, 0)
- textBox.AnchorPoint = Vector2.new(0, 0.5)
- textBox.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
- textBox.Font = Enum.Font.SourceSans
- textBox.Text = text or ""
- textBox.TextColor3 = Color3.fromRGB(220, 220, 220)
- textBox.TextSize = 14
- textBox.ClearTextOnFocus = false
- local cornerBox = Instance.new("UICorner", textBox)
- cornerBox.CornerRadius = UDim.new(0, 4)
- local sendButton = Instance.new("TextButton", entryFrame)
- sendButton.Size = UDim2.new(0, 25, 0, 25)
- sendButton.Position = UDim2.new(1, -60, 0.5, 0)
- sendButton.AnchorPoint = Vector2.new(0, 0.5)
- sendButton.BackgroundColor3 = Color3.fromRGB(60, 160, 80)
- sendButton.Font = Enum.Font.SourceSansBold
- sendButton.Text = "▶"
- sendButton.TextColor3 = Color3.new(1, 1, 1)
- sendButton.TextSize = 16
- local cornerSend = Instance.new("UICorner", sendButton)
- cornerSend.CornerRadius = UDim.new(0, 4)
- local deleteButton = Instance.new("TextButton", entryFrame)
- deleteButton.Size = UDim2.new(0, 25, 0, 25)
- deleteButton.Position = UDim2.new(1, -30, 0.5, 0)
- deleteButton.AnchorPoint = Vector2.new(0, 0.5)
- deleteButton.BackgroundColor3 = Color3.fromRGB(200, 60, 60)
- deleteButton.Font = Enum.Font.SourceSansBold
- deleteButton.Text = "-"
- deleteButton.TextColor3 = Color3.new(1, 1, 1)
- deleteButton.TextSize = 20
- local cornerDel = Instance.new("UICorner", deleteButton)
- cornerDel.CornerRadius = UDim.new(0, 4)
- local entryData = { frame = entryFrame, checkbox = checkBox, textbox = textBox, selected = false }
- table.insert(messageEntries, entryData)
- checkBox.MouseButton1Click:Connect(function()
- entryData.selected = not entryData.selected
- checkBox.Text = entryData.selected and "✓" or ""
- checkBox.BackgroundColor3 = entryData.selected and Color3.fromRGB(80, 120, 220) or Color3.fromRGB(40, 40, 50)
- updateRunButtonText()
- end)
- sendButton.MouseButton1Click:Connect(function() runSequence({ textBox.Text }) end)
- deleteButton.MouseButton1Click:Connect(function()
- for i, entry in ipairs(messageEntries) do
- if entry.frame == entryFrame then
- table.remove(messageEntries, i)
- break
- end
- end
- entryFrame:Destroy()
- updateRunButtonText()
- saveCurrentTabData()
- end)
- textBox.FocusLost:Connect(function() saveCurrentTabData() end)
- end
- function switchTab(tabIndex)
- if not state.tabs[tabIndex] then return end
- if tabButtons[state.activeTabIndex] then
- tabButtons[state.activeTabIndex].BackgroundColor3 = Color3.fromRGB(45, 45, 55)
- end
- if tabButtons[tabIndex] then
- tabButtons[tabIndex].BackgroundColor3 = Color3.fromRGB(65, 65, 75)
- end
- state.activeTabIndex = tabIndex
- for _, entry in ipairs(messageEntries) do
- entry.frame:Destroy()
- end
- messageEntries = {}
- local filePath = Config.SaveFolder .. "/" .. state.tabs[tabIndex].file
- if isfile and isfile(filePath) then
- local success, content = pcall(readfile, filePath)
- if success and content then
- local success2, data = pcall(HttpService.JSONDecode, HttpService, content)
- if success2 and type(data) == "table" then
- for _, msgText in ipairs(data) do
- createMessageEntry(msgText)
- end
- end
- end
- end
- updateRunButtonText()
- saveGlobalConfig()
- end
- function deleteTab(indexToDelete)
- if #state.tabs <= 1 then return end
- local tabInfo = state.tabs[indexToDelete]
- local buttonToDelete = tabButtons[indexToDelete]
- if delfile then
- delfile(Config.SaveFolder .. "/" .. tabInfo.file)
- end
- buttonToDelete:Destroy()
- table.remove(state.tabs, indexToDelete)
- table.remove(tabButtons, indexToDelete)
- for i = indexToDelete, #state.tabs do
- local tabToUpdate = state.tabs[i]
- local buttonToUpdate = tabButtons[i]
- local oldFilePath = Config.SaveFolder .. "/" .. tabToUpdate.file
- local newName = "Tab " .. i
- local newFileName = "Tab_" .. i .. ".json"
- local newFilePath = Config.SaveFolder .. "/" .. newFileName
- if renamefile then
- pcall(renamefile, oldFilePath, newFilePath)
- else
- local success, content = pcall(readfile, oldFilePath)
- if success and content then
- writefile(newFilePath, content)
- delfile(oldFilePath)
- end
- end
- tabToUpdate.name = newName
- tabToUpdate.file = newFileName
- buttonToUpdate.Text = newName
- buttonToUpdate.Name = tostring(i)
- end
- local newActiveIndex = state.activeTabIndex
- if indexToDelete == state.activeTabIndex then
- newActiveIndex = math.max(1, indexToDelete - 1)
- elseif indexToDelete < state.activeTabIndex then
- newActiveIndex = state.activeTabIndex - 1
- end
- switchTab(newActiveIndex)
- end
- function createTabButton(tabInfo, index)
- local button = Instance.new("TextButton", tabScrollingFrame)
- button.Name = tostring(index)
- button.Size = UDim2.new(0, 100, 1, 0)
- button.BackgroundColor3 = Color3.fromRGB(45, 45, 55)
- button.Font = Enum.Font.SourceSans
- button.Text = tabInfo.name
- button.TextColor3 = Color3.new(1, 1, 1)
- button.TextSize = 14
- local corner = Instance.new("UICorner", button)
- corner.CornerRadius = UDim.new(0, 4)
- local closeButton = Instance.new("TextButton", button)
- closeButton.Size = UDim2.new(0, 15, 0, 15)
- closeButton.Position = UDim2.new(1, -10, 0.5, 0)
- closeButton.AnchorPoint = Vector2.new(0.5, 0.5)
- closeButton.BackgroundTransparency = 1
- closeButton.Font = Enum.Font.SourceSansBold
- closeButton.Text = "x"
- closeButton.TextColor3 = Color3.fromRGB(180, 180, 180)
- closeButton.TextSize = 14
- button.MouseButton1Click:Connect(function()
- switchTab(index)
- end)
- closeButton.MouseButton1Click:Connect(function()
- deleteTab(index)
- end)
- table.insert(tabButtons, index, button)
- end
- function addTab()
- local newIndex = #state.tabs + 1
- local newTab = { name = "Tab " .. newIndex, file = "Tab_" .. newIndex .. ".json" }
- table.insert(state.tabs, newTab)
- local success, encoded = pcall(HttpService.JSONEncode, HttpService, { "New Message" })
- if success then
- makefolder(Config.SaveFolder)
- writefile(Config.SaveFolder .. "/" .. newTab.file, encoded)
- end
- createTabButton(newTab, newIndex)
- switchTab(newIndex)
- end
- addMessageButton.MouseButton1Click:Connect(function() createMessageEntry("New Message"); saveCurrentTabData() end)
- 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)
- 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)
- addTabButton.MouseButton1Click:Connect(addTab)
- function createCheckbox(text)
- local frame = Instance.new("Frame", window.SettingsContainer)
- frame.Size = UDim2.new(1, 0, 0, 25)
- frame.BackgroundTransparency = 1
- local label = Instance.new("TextLabel", frame)
- label.Size = UDim2.new(1, -30, 1, 0)
- label.BackgroundTransparency = 1
- label.Font = Enum.Font.SourceSans
- label.TextColor3 = Color3.fromRGB(220, 220, 220)
- label.Text = text
- label.TextSize = 15
- label.TextXAlignment = Enum.TextXAlignment.Left
- local checkBox = Instance.new("TextButton", frame)
- checkBox.Size = UDim2.new(0, 20, 0, 20)
- checkBox.Position = UDim2.new(1, -20, 0.5, 0)
- checkBox.AnchorPoint = Vector2.new(0.5, 0.5)
- checkBox.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
- checkBox.Text = ""
- local corner = Instance.new("UICorner", checkBox)
- corner.CornerRadius = UDim.new(0, 4)
- local value = false
- local api = {}
- local changedEvent = Instance.new("BindableEvent")
- api.Changed = changedEvent.Event
- function api:SetValue(newValue)
- value = newValue
- checkBox.BackgroundColor3 = value and Color3.fromRGB(80, 120, 220) or Color3.fromRGB(40, 40, 50)
- changedEvent:Fire(value)
- end
- checkBox.MouseButton1Click:Connect(function()
- api:SetValue(not value)
- end)
- return api
- end
- function createSlider(text)
- local frame = Instance.new("Frame", window.SettingsContainer)
- frame.Size = UDim2.new(1, 0, 0, 40)
- frame.BackgroundTransparency = 1
- local label = Instance.new("TextLabel", frame)
- label.Size = UDim2.new(1, 0, 0.5, 0)
- label.BackgroundTransparency = 1
- label.Font = Enum.Font.SourceSans
- label.TextColor3 = Color3.fromRGB(220, 220, 220)
- label.Text = text
- label.TextSize = 15
- label.TextXAlignment = Enum.TextXAlignment.Left
- local sliderBar = Instance.new("Frame", frame)
- sliderBar.Size = UDim2.new(1, 0, 0, 6)
- sliderBar.Position = UDim2.new(0, 0, 0.5, 0)
- sliderBar.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
- local corner = Instance.new("UICorner", sliderBar)
- corner.CornerRadius = UDim.new(0, 3)
- local fillBar = Instance.new("Frame", sliderBar)
- fillBar.Size = UDim2.new(0, 0, 1, 0)
- fillBar.BackgroundColor3 = Color3.fromRGB(80, 120, 220)
- local cornerFill = Instance.new("UICorner", fillBar)
- cornerFill.CornerRadius = UDim.new(0, 3)
- local handle = Instance.new("TextButton", sliderBar)
- handle.Size = UDim2.new(0, 16, 0, 16)
- handle.Position = UDim2.new(0, 0, 0.5, 0)
- handle.AnchorPoint = Vector2.new(0.5, 0.5)
- handle.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
- handle.BorderSizePixel = 0
- local cornerHandle = Instance.new("UICorner", handle)
- cornerHandle.CornerRadius = UDim.new(1, 0)
- local value = 0
- local api = {}
- local changedEvent = Instance.new("BindableEvent")
- api.Changed = changedEvent.Event
- function api:SetValue(newValue)
- value = math.clamp(newValue, 0, 1)
- handle.Position = UDim2.new(value, 0, 0.5, 0)
- fillBar.Size = UDim2.new(value, 0, 1, 0)
- changedEvent:Fire(value)
- end
- local function updateFromInput(input)
- api:SetValue((input.Position.X - sliderBar.AbsolutePosition.X) / sliderBar.AbsoluteSize.X)
- end
- sliderBar.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- updateFromInput(input)
- end
- end)
- handle.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- local moveConnection, endConnection
- moveConnection = UserInputService.InputChanged:Connect(function(moveInput)
- if moveInput.UserInputType == Enum.UserInputType.MouseMovement then
- updateFromInput(moveInput)
- end
- end)
- endConnection = UserInputService.InputEnded:Connect(function(endInput)
- if endInput.UserInputType == Enum.UserInputType.MouseButton1 then
- moveConnection:Disconnect()
- endConnection:Disconnect()
- end
- end)
- end
- end)
- return api
- end
- function createTextInput(text, placeholder)
- local frame = Instance.new("Frame", window.SettingsContainer)
- frame.Size = UDim2.new(1, 0, 0, 25)
- frame.BackgroundTransparency = 1
- local label = Instance.new("TextLabel", frame)
- label.Size = UDim2.new(0, 110, 1, 0)
- label.BackgroundTransparency = 1
- label.Font = Enum.Font.SourceSans
- label.TextColor3 = Color3.fromRGB(220, 220, 220)
- label.Text = text
- label.TextSize = 15
- label.TextXAlignment = Enum.TextXAlignment.Left
- local textBox = Instance.new("TextBox", frame)
- textBox.Size = UDim2.new(1, -120, 1, 0)
- textBox.Position = UDim2.new(0, 110, 0, 0)
- textBox.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
- textBox.Font = Enum.Font.SourceSans
- textBox.Text = tostring(state.cacheMessage)
- textBox.PlaceholderText = placeholder or ""
- textBox.TextColor3 = Color3.fromRGB(220, 220, 220)
- textBox.TextSize = 14
- textBox.ClearTextOnFocus = false
- local corner = Instance.new("UICorner", textBox)
- corner.CornerRadius = UDim.new(0, 4)
- textBox.FocusLost:Connect(function(enterPressed)
- if enterPressed then
- state.cacheMessage = textBox.Text
- saveGlobalConfig()
- end
- end)
- return textBox
- end
- shadowCheckbox = createCheckbox("Enable Shadow")
- transparencySlider = createSlider("Transparency")
- cacheInput = createTextInput("Default Cache:", Config.DefaultCacheMessage)
- shadowCheckbox.Changed:Connect(function(v) window.Shadow.Visible = v; state.globalSettings.shadow = v; saveGlobalConfig() end)
- 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)
- 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)
- if makefolder and isfolder and writefile and isfile and HttpService then
- pcall(function()
- function saveGlobalConfig()
- local data = {cooldown = state.cooldown, cacheMessage = state.cacheMessage, globalSettings = state.globalSettings, tabs = state.tabs, activeTabIndex = state.activeTabIndex}
- local success, encoded = pcall(HttpService.JSONEncode, HttpService, data)
- if success then
- makefolder(Config.SaveFolder)
- writefile(Config.SaveFolder .. "/" .. Config.GlobalConfigFile, encoded)
- end
- end
- function saveCurrentTabData()
- local messages = {}
- for _, entry in ipairs(messageEntries) do
- table.insert(messages, entry.textbox.Text)
- end
- if not state.tabs[state.activeTabIndex] then return end
- local filePath = Config.SaveFolder .. "/" .. state.tabs[state.activeTabIndex].file
- local success, encoded = pcall(HttpService.JSONEncode, HttpService, messages)
- if success then
- makefolder(Config.SaveFolder)
- writefile(filePath, encoded)
- end
- end
- function loadSettings()
- local filePath = Config.SaveFolder .. "/" .. Config.GlobalConfigFile
- if not isfile(filePath) then return end
- local success, content = pcall(readfile, filePath)
- if not success or not content then return end
- local decodedSuccess, data = pcall(HttpService.JSONDecode, HttpService, content)
- if not decodedSuccess or type(data) ~= "table" then return end
- if type(data.cooldown) == "number" then state.cooldown = data.cooldown; cooldownInput.Text = tostring(state.cooldown) end
- if type(data.cacheMessage) == "string" then state.cacheMessage = data.cacheMessage; cacheInput.Text = state.cacheMessage end
- 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
- 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
- state.activeTabIndex = data.activeTabIndex or 1
- if state.activeTabIndex > #state.tabs then state.activeTabIndex = 1 end
- for i, tabInfo in ipairs(state.tabs) do createTabButton(tabInfo, i) end
- switchTab(state.activeTabIndex)
- end
- loadSettings()
- end)
- end
- if #state.tabs == 0 then addTab() end
- RunService.RenderStepped:Connect(function()
- scrollFrame.CanvasSize = UDim2.new(0, 0, 0, listLayout.AbsoluteContentSize.Y)
- tabScrollingFrame.CanvasSize = UDim2.new(0, tabLayout.AbsoluteContentSize.X, 0, 0)
- end)
- if not replicatesignal then
- runButton.Text, runButton.BackgroundColor3, runButton.Active = "Error: 'replicatesignal' not found", Color3.fromRGB(200, 60, 60), false
- else
- state.messageId = send_initial_message(state.cacheMessage)
- if not state.messageId then
- runButton.Text, runButton.BackgroundColor3, runButton.Active = "Error: Could not get MessageId", Color3.fromRGB(200, 60, 60), false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment