Advertisement
suramraja1

Untitled

Jun 12th, 2025
801
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.21 KB | None | 0 0
  1. -- Output Capture GUI Script for AWP Executor
  2. -- Captures all Roblox output and displays in custom GUI
  3.  
  4. local Players = game:GetService("Players")
  5. local LogService = game:GetService("LogService")
  6. local TweenService = game:GetService("TweenService")
  7. local UserInputService = game:GetService("UserInputService")
  8. local RunService = game:GetService("RunService")
  9.  
  10. local Player = Players.LocalPlayer
  11. local PlayerGui = Player:WaitForChild("PlayerGui")
  12.  
  13. -- Object Hierarchy:
  14. -- PlayerGui
  15. -- └── OutputCaptureGUI
  16. --     └── MainFrame
  17. --         ├── TopBar
  18. --         │   ├── Title
  19. --         │   ├── MinimizeButton
  20. --         │   └── CloseButton
  21. --         ├── OutputFrame
  22. --         │   ├── ScrollingFrame
  23. --         │   │   └── OutputList (UIListLayout)
  24. --         │   └── ScrollBar
  25. --         └── ControlsFrame
  26. --             ├── ClearButton
  27. --             ├── FilterFrame
  28. --             │   ├── InfoToggle
  29. --             │   ├── WarningToggle
  30. --             │   └── ErrorToggle
  31. --             └── ResizeHandle
  32.  
  33. -- Main GUI Creation
  34. local OutputCaptureGUI = Instance.new("ScreenGui")
  35. OutputCaptureGUI.Name = "OutputCaptureGUI"
  36. OutputCaptureGUI.ResetOnSpawn = false
  37. OutputCaptureGUI.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  38. OutputCaptureGUI.Parent = PlayerGui
  39.  
  40. -- Main Frame
  41. local MainFrame = Instance.new("Frame")
  42. MainFrame.Name = "MainFrame"
  43. MainFrame.Size = UDim2.new(0, 600, 0, 400)
  44. MainFrame.Position = UDim2.new(0.5, -300, 0.5, -200)
  45. MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  46. MainFrame.BorderSizePixel = 0
  47. MainFrame.Active = true
  48. MainFrame.Draggable = true
  49. MainFrame.Parent = OutputCaptureGUI
  50.  
  51. -- Corner rounding
  52. local MainCorner = Instance.new("UICorner")
  53. MainCorner.CornerRadius = UDim.new(0, 8)
  54. MainCorner.Parent = MainFrame
  55.  
  56. -- Top Bar
  57. local TopBar = Instance.new("Frame")
  58. TopBar.Name = "TopBar"
  59. TopBar.Size = UDim2.new(1, 0, 0, 30)
  60. TopBar.Position = UDim2.new(0, 0, 0, 0)
  61. TopBar.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  62. TopBar.BorderSizePixel = 0
  63. TopBar.Parent = MainFrame
  64.  
  65. local TopBarCorner = Instance.new("UICorner")
  66. TopBarCorner.CornerRadius = UDim.new(0, 8)
  67. TopBarCorner.Parent = TopBar
  68.  
  69. -- Title
  70. local Title = Instance.new("TextLabel")
  71. Title.Name = "Title"
  72. Title.Size = UDim2.new(1, -60, 1, 0)
  73. Title.Position = UDim2.new(0, 10, 0, 0)
  74. Title.BackgroundTransparency = 1
  75. Title.Text = "Roblox Output Capture"
  76. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  77. Title.TextSize = 14
  78. Title.TextXAlignment = Enum.TextXAlignment.Left
  79. Title.Font = Enum.Font.SourceSansBold
  80. Title.Parent = TopBar
  81.  
  82. -- Minimize Button
  83. local MinimizeButton = Instance.new("TextButton")
  84. MinimizeButton.Name = "MinimizeButton"
  85. MinimizeButton.Size = UDim2.new(0, 25, 0, 25)
  86. MinimizeButton.Position = UDim2.new(1, -55, 0, 2.5)
  87. MinimizeButton.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  88. MinimizeButton.BorderSizePixel = 0
  89. MinimizeButton.Text = "-"
  90. MinimizeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  91. MinimizeButton.TextSize = 16
  92. MinimizeButton.Font = Enum.Font.SourceSansBold
  93. MinimizeButton.Parent = TopBar
  94.  
  95. local MinimizeCorner = Instance.new("UICorner")
  96. MinimizeCorner.CornerRadius = UDim.new(0, 4)
  97. MinimizeCorner.Parent = MinimizeButton
  98.  
  99. -- Close Button
  100. local CloseButton = Instance.new("TextButton")
  101. CloseButton.Name = "CloseButton"
  102. CloseButton.Size = UDim2.new(0, 25, 0, 25)
  103. CloseButton.Position = UDim2.new(1, -27, 0, 2.5)
  104. CloseButton.BackgroundColor3 = Color3.fromRGB(220, 53, 69)
  105. CloseButton.BorderSizePixel = 0
  106. CloseButton.Text = "×"
  107. CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  108. CloseButton.TextSize = 16
  109. CloseButton.Font = Enum.Font.SourceSansBold
  110. CloseButton.Parent = TopBar
  111.  
  112. local CloseCorner = Instance.new("UICorner")
  113. CloseCorner.CornerRadius = UDim.new(0, 4)
  114. CloseCorner.Parent = CloseButton
  115.  
  116. -- Output Frame
  117. local OutputFrame = Instance.new("Frame")
  118. OutputFrame.Name = "OutputFrame"
  119. OutputFrame.Size = UDim2.new(1, -20, 1, -80)
  120. OutputFrame.Position = UDim2.new(0, 10, 0, 35)
  121. OutputFrame.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
  122. OutputFrame.BorderSizePixel = 0
  123. OutputFrame.Parent = MainFrame
  124.  
  125. local OutputCorner = Instance.new("UICorner")
  126. OutputCorner.CornerRadius = UDim.new(0, 6)
  127. OutputCorner.Parent = OutputFrame
  128.  
  129. -- Scrolling Frame
  130. local ScrollingFrame = Instance.new("ScrollingFrame")
  131. ScrollingFrame.Name = "ScrollingFrame"
  132. ScrollingFrame.Size = UDim2.new(1, -10, 1, -10)
  133. ScrollingFrame.Position = UDim2.new(0, 5, 0, 5)
  134. ScrollingFrame.BackgroundTransparency = 1
  135. ScrollingFrame.BorderSizePixel = 0
  136. ScrollingFrame.ScrollBarThickness = 8
  137. ScrollingFrame.ScrollBarImageColor3 = Color3.fromRGB(100, 100, 100)
  138. ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
  139. ScrollingFrame.Parent = OutputFrame
  140.  
  141. -- Output List Layout
  142. local OutputList = Instance.new("UIListLayout")
  143. OutputList.Name = "OutputList"
  144. OutputList.SortOrder = Enum.SortOrder.LayoutOrder
  145. OutputList.Padding = UDim.new(0, 2)
  146. OutputList.Parent = ScrollingFrame
  147.  
  148. -- Controls Frame
  149. local ControlsFrame = Instance.new("Frame")
  150. ControlsFrame.Name = "ControlsFrame"
  151. ControlsFrame.Size = UDim2.new(1, -20, 0, 35)
  152. ControlsFrame.Position = UDim2.new(0, 10, 1, -40)
  153. ControlsFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  154. ControlsFrame.BorderSizePixel = 0
  155. ControlsFrame.Parent = MainFrame
  156.  
  157. local ControlsCorner = Instance.new("UICorner")
  158. ControlsCorner.CornerRadius = UDim.new(0, 6)
  159. ControlsCorner.Parent = ControlsFrame
  160.  
  161. -- Clear Button
  162. local ClearButton = Instance.new("TextButton")
  163. ClearButton.Name = "ClearButton"
  164. ClearButton.Size = UDim2.new(0, 60, 0, 25)
  165. ClearButton.Position = UDim2.new(0, 10, 0, 5)
  166. ClearButton.BackgroundColor3 = Color3.fromRGB(220, 53, 69)
  167. ClearButton.BorderSizePixel = 0
  168. ClearButton.Text = "Clear"
  169. ClearButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  170. ClearButton.TextSize = 12
  171. ClearButton.Font = Enum.Font.SourceSans
  172. ClearButton.Parent = ControlsFrame
  173.  
  174. local ClearCorner = Instance.new("UICorner")
  175. ClearCorner.CornerRadius = UDim.new(0, 4)
  176. ClearCorner.Parent = ClearButton
  177.  
  178. -- Filter toggles
  179. local filterButtons = {}
  180. local filters = {
  181.     {name = "Info", color = Color3.fromRGB(70, 130, 180), enabled = true},
  182.     {name = "Warning", color = Color3.fromRGB(255, 193, 7), enabled = true},
  183.     {name = "Error", color = Color3.fromRGB(220, 53, 69), enabled = true}
  184. }
  185.  
  186. for i, filter in ipairs(filters) do
  187.     local button = Instance.new("TextButton")
  188.     button.Name = filter.name .. "Toggle"
  189.     button.Size = UDim2.new(0, 60, 0, 25)
  190.     button.Position = UDim2.new(0, 80 + (i-1)*70, 0, 5)
  191.     button.BackgroundColor3 = filter.enabled and filter.color or Color3.fromRGB(60, 60, 60)
  192.     button.BorderSizePixel = 0
  193.     button.Text = filter.name
  194.     button.TextColor3 = Color3.fromRGB(255, 255, 255)
  195.     button.TextSize = 11
  196.     button.Font = Enum.Font.SourceSans
  197.     button.Parent = ControlsFrame
  198.    
  199.     local buttonCorner = Instance.new("UICorner")
  200.     buttonCorner.CornerRadius = UDim.new(0, 4)
  201.     buttonCorner.Parent = button
  202.    
  203.     filterButtons[filter.name:lower()] = {button = button, enabled = filter.enabled, color = filter.color}
  204. end
  205.  
  206. -- Variables for output management
  207. local outputMessages = {}
  208. local messageCount = 0
  209. local isMinimized = false
  210. local maxMessages = 1000 -- Memory optimization
  211.  
  212. -- Message type colors
  213. local messageColors = {
  214.     [Enum.MessageType.MessageOutput] = Color3.fromRGB(255, 255, 255),
  215.     [Enum.MessageType.MessageInfo] = Color3.fromRGB(70, 130, 180),
  216.     [Enum.MessageType.MessageWarning] = Color3.fromRGB(255, 193, 7),
  217.     [Enum.MessageType.MessageError] = Color3.fromRGB(220, 53, 69)
  218. }
  219.  
  220. -- Message type names
  221. local messageTypeNames = {
  222.     [Enum.MessageType.MessageOutput] = "output",
  223.     [Enum.MessageType.MessageInfo] = "info",
  224.     [Enum.MessageType.MessageWarning] = "warning",
  225.     [Enum.MessageType.MessageError] = "error"
  226. }
  227.  
  228. -- Function to create message entry
  229. local function createMessageEntry(message, messageType, timestamp)
  230.     local messageFrame = Instance.new("Frame")
  231.     messageFrame.Name = "MessageEntry"
  232.     messageFrame.Size = UDim2.new(1, -10, 0, 0)
  233.     messageFrame.BackgroundTransparency = 1
  234.     messageFrame.BorderSizePixel = 0
  235.     messageFrame.LayoutOrder = messageCount
  236.    
  237.     local messageLabel = Instance.new("TextLabel")
  238.     messageLabel.Name = "MessageLabel"
  239.     messageLabel.Size = UDim2.new(1, 0, 1, 0)
  240.     messageLabel.BackgroundTransparency = 1
  241.     messageLabel.Text = string.format("[%s] %s", timestamp, message)
  242.     messageLabel.TextColor3 = messageColors[messageType] or Color3.fromRGB(255, 255, 255)
  243.     messageLabel.TextSize = 12
  244.     messageLabel.Font = Enum.Font.SourceSans
  245.     messageLabel.TextXAlignment = Enum.TextXAlignment.Left
  246.     messageLabel.TextYAlignment = Enum.TextYAlignment.Top
  247.     messageLabel.TextWrapped = true
  248.     messageLabel.RichText = true
  249.     messageLabel.Parent = messageFrame
  250.    
  251.     -- Calculate text height
  252.     local textSize = game:GetService("TextService"):GetTextSize(
  253.         messageLabel.Text,
  254.         messageLabel.TextSize,
  255.         messageLabel.Font,
  256.         Vector2.new(ScrollingFrame.AbsoluteSize.X - 20, math.huge)
  257.     )
  258.    
  259.     messageFrame.Size = UDim2.new(1, -10, 0, math.max(textSize.Y + 4, 16))
  260.    
  261.     -- Store message type for filtering
  262.     messageFrame:SetAttribute("MessageType", messageTypeNames[messageType] or "output")
  263.    
  264.     return messageFrame
  265. end
  266.  
  267. -- Function to add message to GUI
  268. local function addMessage(message, messageType, timestamp)
  269.     local messageEntry = createMessageEntry(message, messageType, timestamp)
  270.     messageEntry.Parent = ScrollingFrame
  271.    
  272.     messageCount = messageCount + 1
  273.     outputMessages[messageCount] = {frame = messageEntry, type = messageTypeNames[messageType] or "output"}
  274.    
  275.     -- Memory management - remove old messages
  276.     if messageCount > maxMessages then
  277.         local oldMessage = outputMessages[messageCount - maxMessages]
  278.         if oldMessage and oldMessage.frame then
  279.             oldMessage.frame:Destroy()
  280.         end
  281.         outputMessages[messageCount - maxMessages] = nil
  282.     end
  283.    
  284.     -- Update canvas size
  285.     RunService.Heartbeat:Wait()
  286.     ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, OutputList.AbsoluteContentSize.Y + 10)
  287.    
  288.     -- Auto-scroll to bottom
  289.     ScrollingFrame.CanvasPosition = Vector2.new(0, ScrollingFrame.CanvasSize.Y.Offset)
  290. end
  291.  
  292. -- Function to filter messages
  293. local function filterMessages()
  294.     for _, messageData in pairs(outputMessages) do
  295.         if messageData.frame and messageData.frame.Parent then
  296.             local messageType = messageData.type
  297.             local filterData = filterButtons[messageType]
  298.            
  299.             if filterData then
  300.                 messageData.frame.Visible = filterData.enabled
  301.             else
  302.                 messageData.frame.Visible = filterButtons.info.enabled -- Default to info filter
  303.             end
  304.         end
  305.     end
  306.    
  307.     -- Update canvas size after filtering
  308.     RunService.Heartbeat:Wait()
  309.     ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, OutputList.AbsoluteContentSize.Y + 10)
  310. end
  311.  
  312. -- Function to clear all messages
  313. local function clearMessages()
  314.     for _, messageData in pairs(outputMessages) do
  315.         if messageData.frame then
  316.             messageData.frame:Destroy()
  317.         end
  318.     end
  319.     outputMessages = {}
  320.     messageCount = 0
  321.     ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
  322. end
  323.  
  324. -- Function to toggle minimize
  325. local function toggleMinimize()
  326.     isMinimized = not isMinimized
  327.    
  328.     local targetSize = isMinimized and UDim2.new(0, 600, 0, 30) or UDim2.new(0, 600, 0, 400)
  329.     local targetPos = isMinimized and UDim2.new(0.5, -300, 0, 10) or UDim2.new(0.5, -300, 0.5, -200)
  330.    
  331.     local tween = TweenService:Create(MainFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quart), {
  332.         Size = targetSize,
  333.         Position = targetPos
  334.     })
  335.     tween:Play()
  336.    
  337.     OutputFrame.Visible = not isMinimized
  338.     ControlsFrame.Visible = not isMinimized
  339.     MinimizeButton.Text = isMinimized and "+" or "-"
  340. end
  341.  
  342. -- Event connections
  343. ClearButton.MouseButton1Click:Connect(clearMessages)
  344. MinimizeButton.MouseButton1Click:Connect(toggleMinimize)
  345. CloseButton.MouseButton1Click:Connect(function()
  346.     OutputCaptureGUI:Destroy()
  347. end)
  348.  
  349. -- Filter button connections
  350. for filterName, filterData in pairs(filterButtons) do
  351.     filterData.button.MouseButton1Click:Connect(function()
  352.         filterData.enabled = not filterData.enabled
  353.         filterData.button.BackgroundColor3 = filterData.enabled and filterData.color or Color3.fromRGB(60, 60, 60)
  354.         filterMessages()
  355.     end)
  356. end
  357.  
  358. -- LogService connection for capturing output
  359. local logConnection = LogService.MessageOut:Connect(function(message, messageType)
  360.     local timestamp = os.date("%H:%M:%S")
  361.     addMessage(message, messageType, timestamp)
  362. end)
  363.  
  364. -- Cleanup on GUI destruction
  365. OutputCaptureGUI.AncestryChanged:Connect(function()
  366.     if not OutputCaptureGUI.Parent then
  367.         if logConnection then
  368.             logConnection:Disconnect()
  369.         end
  370.     end
  371. end)
  372.  
  373. -- Initial message
  374. addMessage("Output Capture GUI initialized successfully!", Enum.MessageType.MessageInfo, os.date("%H:%M:%S"))
  375.  
  376. print("Output Capture GUI loaded! Use the interface to monitor all Roblox output.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement