Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LogService = game:GetService("LogService")
- UserInputService = game:GetService("UserInputService")
- RunService = game:GetService("RunService")
- CoreGui = game:GetService("CoreGui")
- DraggingSystem = {}
- function DraggingSystem.GetDistance(pos1, pos2)
- return math.sqrt((pos2.X - pos1.X)^2 + (pos2.Y - pos1.Y)^2)
- end
- function DraggingSystem.IsMouseOverFrame(Frame, Position)
- AbsPos, AbsSize = Frame.AbsolutePosition, Frame.AbsoluteSize
- return Position.X >= AbsPos.X and Position.X <= AbsPos.X + AbsSize.X and Position.Y >= AbsPos.Y and Position.Y <= AbsPos.Y + AbsSize.Y
- end
- function DraggingSystem.MakeDraggable(MainFrame, DragFrame, CallbackTable)
- if not MainFrame or not DragFrame then return end
- dragging = false
- dragStart = nil
- startPos = nil
- dragDistance = 0
- DRAG_THRESHOLD = 5
- originalZIndex = MainFrame.ZIndex
- isDraggingStarted = false
- currentTouch = nil
- function getScreenSize()
- return workspace.CurrentCamera.ViewportSize
- end
- function updatePosition(input)
- if not dragging or not dragStart then return end
- delta = input.Position - dragStart
- dragDistance = math.sqrt(delta.X^2 + delta.Y^2)
- screenSize = getScreenSize()
- newOffsetX = startPos.X.Offset + delta.X
- newOffsetY = startPos.Y.Offset + delta.Y
- newScaleX = startPos.X.Scale
- newScaleY = startPos.Y.Scale
- if startPos.X.Scale > 0 then
- scaleOffsetX = (screenSize.X * startPos.X.Scale) + startPos.X.Offset
- newAbsoluteX = scaleOffsetX + delta.X
- newScaleX = newAbsoluteX / screenSize.X
- newOffsetX = 0
- end
- if startPos.Y.Scale > 0 then
- scaleOffsetY = (screenSize.Y * startPos.Y.Scale) + startPos.Y.Offset
- newAbsoluteY = scaleOffsetY + delta.Y
- newScaleY = newAbsoluteY / screenSize.Y
- newOffsetY = 0
- end
- MainFrame.Position = UDim2.new(newScaleX, newOffsetX, newScaleY, newOffsetY)
- if CallbackTable and CallbackTable.OnDragUpdate then
- CallbackTable.OnDragUpdate(MainFrame.Position, dragDistance)
- end
- end
- function resetDragState()
- dragging = false
- dragStart = nil
- startPos = nil
- dragDistance = 0
- isDraggingStarted = false
- currentTouch = nil
- end
- mouseButton1Connection = nil
- touchEndedConnection = nil
- movementConnection = nil
- function onInputEnded()
- if dragging then
- wasDragged = dragDistance > DRAG_THRESHOLD
- if not wasDragged and CallbackTable and CallbackTable.OnClick then
- CallbackTable.OnClick()
- end
- if wasDragged and isDraggingStarted then
- MainFrame.ZIndex = originalZIndex
- if CallbackTable and CallbackTable.OnDragEnd then
- CallbackTable.OnDragEnd(MainFrame.Position, wasDragged)
- end
- end
- resetDragState()
- if mouseButton1Connection then
- mouseButton1Connection:Disconnect()
- mouseButton1Connection = nil
- end
- if touchEndedConnection then
- touchEndedConnection:Disconnect()
- touchEndedConnection = nil
- end
- if movementConnection then
- movementConnection:Disconnect()
- movementConnection = nil
- end
- end
- end
- function onInputEndedHandler(endInput)
- if dragging then
- if endInput.UserInputType == Enum.UserInputType.MouseButton1 then
- onInputEnded()
- elseif endInput.UserInputType == Enum.UserInputType.Touch and endInput == currentTouch then
- onInputEnded()
- end
- end
- end
- function onMovement(input)
- if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input == currentTouch) then
- if not isDraggingStarted and dragDistance > DRAG_THRESHOLD then
- isDraggingStarted = true
- if CallbackTable and CallbackTable.OnDragStart then
- CallbackTable.OnDragStart()
- end
- end
- updatePosition(input)
- end
- end
- function onInputBegan(input)
- if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and input.UserInputState == Enum.UserInputState.Begin and not dragging then
- if DraggingSystem.IsMouseOverFrame(DragFrame, input.Position) then
- dragging = true
- dragStart = input.Position
- startPos = MainFrame.Position
- dragDistance = 0
- isDraggingStarted = false
- if input.UserInputType == Enum.UserInputType.Touch then
- currentTouch = input
- else
- currentTouch = nil
- end
- mouseButton1Connection = UserInputService.InputEnded:Connect(function(endInput)
- if endInput.UserInputType == Enum.UserInputType.MouseButton1 then
- onInputEndedHandler(endInput)
- end
- end)
- touchEndedConnection = UserInputService.InputEnded:Connect(function(endInput)
- if endInput.UserInputType == Enum.UserInputType.Touch then
- onInputEndedHandler(endInput)
- end
- end)
- movementConnection = UserInputService.InputChanged:Connect(function(moveInput)
- if moveInput.UserInputType == Enum.UserInputType.MouseMovement or moveInput.UserInputType == Enum.UserInputType.Touch then
- onMovement(moveInput)
- end
- end)
- end
- end
- end
- inputBeganConnection = DragFrame.InputBegan:Connect(onInputBegan)
- cleanupFunction = function()
- inputBeganConnection:Disconnect()
- if mouseButton1Connection then mouseButton1Connection:Disconnect() end
- if touchEndedConnection then touchEndedConnection:Disconnect() end
- if movementConnection then movementConnection:Disconnect() end
- end
- return cleanupFunction
- end
- ResizeSystem = {}
- function ResizeSystem.MakeResizable(MainFrame, ResizeHandle, CallbackTable)
- if not MainFrame or not ResizeHandle then return end
- resizing = false
- resizeStart = nil
- startSize = nil
- startPosition = nil
- resizeMode = "right"
- activeTouch = nil
- function updateResize(input)
- if not resizing or not resizeStart then return end
- delta = input.Position - resizeStart
- newWidth = startSize.X.Offset
- newHeight = startSize.Y.Offset
- newX = startPosition.X.Offset
- newY = startPosition.Y.Offset
- if resizeMode == "right" then
- newWidth = math.max(396, startSize.X.Offset + delta.X)
- MainFrame.Size = UDim2.new(0, newWidth, 0, newHeight)
- elseif resizeMode == "left" then
- newWidth = math.max(396, startSize.X.Offset - delta.X)
- newX = startPosition.X.Offset + (startSize.X.Offset - newWidth)
- MainFrame.Size = UDim2.new(0, newWidth, 0, newHeight)
- MainFrame.Position = UDim2.new(startPosition.X.Scale, newX, startPosition.Y.Scale, newY)
- elseif resizeMode == "bottom" then
- newHeight = math.max(200, startSize.Y.Offset + delta.Y)
- MainFrame.Size = UDim2.new(0, newWidth, 0, newHeight)
- elseif resizeMode == "top" then
- newHeight = math.max(200, startSize.Y.Offset - delta.Y)
- newY = startPosition.Y.Offset + (startSize.Y.Offset - newHeight)
- MainFrame.Size = UDim2.new(0, newWidth, 0, newHeight)
- MainFrame.Position = UDim2.new(startPosition.X.Scale, newX, startPosition.Y.Scale, newY)
- elseif resizeMode == "bottomRight" then
- newWidth = math.max(396, startSize.X.Offset + delta.X)
- newHeight = math.max(200, startSize.Y.Offset + delta.Y)
- MainFrame.Size = UDim2.new(0, newWidth, 0, newHeight)
- elseif resizeMode == "bottomLeft" then
- newWidth = math.max(396, startSize.X.Offset - delta.X)
- newHeight = math.max(200, startSize.Y.Offset + delta.Y)
- newX = startPosition.X.Offset + (startSize.X.Offset - newWidth)
- MainFrame.Size = UDim2.new(0, newWidth, 0, newHeight)
- MainFrame.Position = UDim2.new(startPosition.X.Scale, newX, startPosition.Y.Scale, newY)
- elseif resizeMode == "topRight" then
- newWidth = math.max(396, startSize.X.Offset + delta.X)
- newHeight = math.max(200, startSize.Y.Offset - delta.Y)
- newY = startPosition.Y.Offset + (startSize.Y.Offset - newHeight)
- MainFrame.Size = UDim2.new(0, newWidth, 0, newHeight)
- MainFrame.Position = UDim2.new(startPosition.X.Scale, newX, startPosition.Y.Scale, newY)
- elseif resizeMode == "topLeft" then
- newWidth = math.max(396, startSize.X.Offset - delta.X)
- newHeight = math.max(200, startSize.Y.Offset - delta.Y)
- newX = startPosition.X.Offset + (startSize.X.Offset - newWidth)
- newY = startPosition.Y.Offset + (startSize.Y.Offset - newHeight)
- MainFrame.Size = UDim2.new(0, newWidth, 0, newHeight)
- MainFrame.Position = UDim2.new(startPosition.X.Scale, newX, startPosition.Y.Scale, newY)
- end
- if CallbackTable and CallbackTable.OnResizeUpdate then
- CallbackTable.OnResizeUpdate(MainFrame.Size, MainFrame.Position)
- end
- updateScrollability()
- end
- function resetResizeState()
- resizing = false
- resizeStart = nil
- startSize = nil
- startPosition = nil
- activeTouch = nil
- end
- mouseConnection = nil
- touchConnection = nil
- moveConnection = nil
- function onResizeEnd()
- if resizing then
- if CallbackTable and CallbackTable.OnResizeEnd then
- CallbackTable.OnResizeEnd(MainFrame.Size)
- end
- resetResizeState()
- if mouseConnection then mouseConnection:Disconnect() end
- if touchConnection then touchConnection:Disconnect() end
- if moveConnection then moveConnection:Disconnect() end
- end
- end
- function onResizeMovement(input)
- if resizing then
- if input.UserInputType == Enum.UserInputType.MouseMovement then
- updateResize(input)
- elseif input.UserInputType == Enum.UserInputType.Touch and input == activeTouch then
- updateResize(input)
- end
- end
- end
- function onResizeBegan(input)
- if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and input.UserInputState == Enum.UserInputState.Begin and not resizing then
- if DraggingSystem.IsMouseOverFrame(ResizeHandle, input.Position) then
- resizing = true
- resizeStart = input.Position
- startSize = MainFrame.Size
- startPosition = MainFrame.Position
- if input.UserInputType == Enum.UserInputType.Touch then
- activeTouch = input
- else
- activeTouch = nil
- end
- if ResizeHandle.Name == "ResizeRight" then
- resizeMode = "right"
- elseif ResizeHandle.Name == "ResizeLeft" then
- resizeMode = "left"
- elseif ResizeHandle.Name == "ResizeBottom" then
- resizeMode = "bottom"
- elseif ResizeHandle.Name == "ResizeTop" then
- resizeMode = "top"
- elseif ResizeHandle.Name == "ResizeBottomRight" then
- resizeMode = "bottomRight"
- elseif ResizeHandle.Name == "ResizeBottomLeft" then
- resizeMode = "bottomLeft"
- elseif ResizeHandle.Name == "ResizeTopRight" then
- resizeMode = "topRight"
- elseif ResizeHandle.Name == "ResizeTopLeft" then
- resizeMode = "topLeft"
- end
- if CallbackTable and CallbackTable.OnResizeStart then
- CallbackTable.OnResizeStart()
- end
- mouseConnection = UserInputService.InputEnded:Connect(function(endInput)
- if endInput.UserInputType == Enum.UserInputType.MouseButton1 then
- onResizeEnd()
- end
- end)
- touchConnection = UserInputService.InputEnded:Connect(function(endInput)
- if endInput.UserInputType == Enum.UserInputType.Touch and endInput == activeTouch then
- onResizeEnd()
- end
- end)
- moveConnection = UserInputService.InputChanged:Connect(function(moveInput)
- if moveInput.UserInputType == Enum.UserInputType.MouseMovement then
- onResizeMovement(moveInput)
- elseif moveInput.UserInputType == Enum.UserInputType.Touch and moveInput == activeTouch then
- onResizeMovement(moveInput)
- end
- end)
- end
- end
- end
- inputBeganConnection = ResizeHandle.InputBegan:Connect(onResizeBegan)
- cleanupFunction = function()
- inputBeganConnection:Disconnect()
- if mouseConnection then mouseConnection:Disconnect() end
- if touchConnection then touchConnection:Disconnect() end
- if moveConnection then moveConnection:Disconnect() end
- end
- return cleanupFunction
- end
- function getDPIScale()
- return 0.9
- end
- function updateScrollability()
- task.wait()
- local containerHeight = logContainer.AbsoluteSize.Y
- local contentHeight = logList.AbsoluteContentSize.Y
- if contentHeight > containerHeight then
- logContainer.ScrollBarThickness = 6
- logContainer.ScrollingEnabled = true
- else
- logContainer.ScrollBarThickness = 0
- logContainer.ScrollingEnabled = false
- end
- end
- autoScroll = true
- textSize = 12
- screenGui = Instance.new("ScreenGui")
- screenGui.Name = "RBXConsole"
- screenGui.ResetOnSpawn = false
- screenGui.Enabled = false
- screenGui.Parent = CoreGui
- mainFrame = Instance.new("Frame")
- mainFrame.Name = "Main"
- mainFrame.Size = UDim2.new(0, 550, 0, 400)
- mainFrame.Position = UDim2.new(0.5, -275, 0.5, -200)
- mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 35)
- mainFrame.BackgroundTransparency = 0.3
- mainFrame.BorderSizePixel = 0
- mainFrame.Active = true
- mainFrame.Parent = screenGui
- uiScale = Instance.new("UIScale")
- uiScale.Scale = getDPIScale()
- uiScale.Parent = mainFrame
- uiCorner = Instance.new("UICorner")
- uiCorner.CornerRadius = UDim.new(0, 8)
- uiCorner.Parent = mainFrame
- uiStroke = Instance.new("UIStroke")
- uiStroke.Color = Color3.fromRGB(60, 60, 70)
- uiStroke.Thickness = 1
- uiStroke.Parent = mainFrame
- titleBar = Instance.new("Frame")
- titleBar.Name = "TitleBar"
- titleBar.Size = UDim2.new(1, 0, 0, 40)
- titleBar.BackgroundColor3 = Color3.fromRGB(40, 40, 45)
- titleBar.BackgroundTransparency = 0.3
- titleBar.BorderSizePixel = 0
- titleBar.Parent = mainFrame
- tbCorner = Instance.new("UICorner")
- tbCorner.CornerRadius = UDim.new(0, 8)
- tbCorner.Parent = titleBar
- title = Instance.new("TextLabel")
- title.Size = UDim2.new(1, -60, 1, 0)
- title.Position = UDim2.new(0, 15, 0, 0)
- title.BackgroundTransparency = 1
- title.Text = "RBX Console"
- title.TextColor3 = Color3.fromRGB(240, 240, 240)
- title.TextXAlignment = Enum.TextXAlignment.Left
- title.Font = Enum.Font.GothamBold
- title.TextSize = 14
- title.Parent = titleBar
- controls = Instance.new("Frame")
- controls.Size = UDim2.new(0, 340, 1, 0)
- controls.Position = UDim2.new(1, -345, 0, 0)
- controls.BackgroundTransparency = 1
- controls.Parent = titleBar
- controlList = Instance.new("UIListLayout")
- controlList.SortOrder = Enum.SortOrder.LayoutOrder
- controlList.FillDirection = Enum.FillDirection.Horizontal
- controlList.HorizontalAlignment = Enum.HorizontalAlignment.Right
- controlList.VerticalAlignment = Enum.VerticalAlignment.Center
- controlList.Padding = UDim.new(0, 5)
- controlList.Parent = controls
- function createButton(name, text, color)
- btn = Instance.new("TextButton")
- btn.Name = name
- btn.Size = UDim2.new(0, 65, 0, 25)
- btn.BackgroundColor3 = color
- btn.BackgroundTransparency = 0.2
- btn.Text = text
- btn.TextColor3 = Color3.fromRGB(255, 255, 255)
- btn.Font = Enum.Font.GothamBold
- btn.TextSize = 11
- btn.BorderSizePixel = 0
- btn.Parent = controls
- Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 4)
- return btn
- end
- autoScrollBtn = createButton("AutoScroll", "Scroll: ON", Color3.fromRGB(60, 100, 180))
- copyAllBtn = createButton("CopyAll", "Copy All", Color3.fromRGB(60, 120, 60))
- clearBtn = createButton("Clear", "Clear", Color3.fromRGB(80, 80, 85))
- textSizeBox = Instance.new("TextBox")
- textSizeBox.Size = UDim2.new(0, 50, 0, 25)
- textSizeBox.BackgroundColor3 = Color3.fromRGB(80, 80, 85)
- textSizeBox.BackgroundTransparency = 0.2
- textSizeBox.Text = "12"
- textSizeBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- textSizeBox.Font = Enum.Font.GothamBold
- textSizeBox.TextSize = 11
- textSizeBox.PlaceholderText = "Size"
- textSizeBox.Parent = controls
- Instance.new("UICorner", textSizeBox).CornerRadius = UDim.new(0, 4)
- closeBtn = createButton("Close", "X", Color3.fromRGB(180, 60, 60))
- closeBtn.Size = UDim2.new(0, 30, 0, 25)
- function updateTextSize()
- local newSize = tonumber(textSizeBox.Text)
- if newSize then
- textSize = newSize
- for _, logFrame in ipairs(logContainer:GetChildren()) do
- if logFrame:IsA("Frame") then
- textLabel = logFrame:FindFirstChild("TextLabel")
- if textLabel then
- textLabel.TextSize = textSize
- end
- end
- end
- end
- end
- textSizeBox.FocusLost:Connect(function()
- updateTextSize()
- end)
- logContainer = Instance.new("ScrollingFrame")
- logContainer.Name = "Logs"
- logContainer.Size = UDim2.new(1, -20, 1, -60)
- logContainer.Position = UDim2.new(0, 10, 0, 50)
- logContainer.BackgroundColor3 = Color3.fromRGB(20, 20, 23)
- logContainer.BackgroundTransparency = 0.5
- logContainer.BorderSizePixel = 0
- logContainer.ScrollBarThickness = 0
- logContainer.ScrollingEnabled = false
- logContainer.AutomaticCanvasSize = Enum.AutomaticSize.Y
- logContainer.CanvasSize = UDim2.new(0, 0, 0, 0)
- logContainer.Parent = mainFrame
- logList = Instance.new("UIListLayout")
- logList.SortOrder = Enum.SortOrder.LayoutOrder
- logList.Padding = UDim.new(0, 4)
- logList.Parent = logContainer
- Instance.new("UIPadding", logContainer).PaddingLeft = UDim.new(0, 5)
- logList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(updateScrollability)
- logContainer:GetPropertyChangedSignal("AbsoluteSize"):Connect(updateScrollability)
- function createResizeHandle(name, position, size)
- handle = Instance.new("TextButton")
- handle.Name = name
- handle.Size = size
- handle.Position = position
- handle.BackgroundTransparency = 1
- handle.Text = ""
- handle.AutoButtonColor = false
- handle.Parent = mainFrame
- return handle
- end
- resizeRight = createResizeHandle("ResizeRight", UDim2.new(1, -4, 0, 0), UDim2.new(0, 8, 1, 0))
- resizeLeft = createResizeHandle("ResizeLeft", UDim2.new(0, -4, 0, 0), UDim2.new(0, 8, 1, 0))
- resizeBottom = createResizeHandle("ResizeBottom", UDim2.new(0, 0, 1, -4), UDim2.new(1, 0, 0, 8))
- resizeTop = createResizeHandle("ResizeTop", UDim2.new(0, 0, 0, -4), UDim2.new(1, 0, 0, 8))
- resizeBottomRight = createResizeHandle("ResizeBottomRight", UDim2.new(1, -8, 1, -8), UDim2.new(0, 16, 0, 16))
- resizeBottomLeft = createResizeHandle("ResizeBottomLeft", UDim2.new(0, -8, 1, -8), UDim2.new(0, 16, 0, 16))
- resizeTopRight = createResizeHandle("ResizeTopRight", UDim2.new(1, -8, 0, -8), UDim2.new(0, 16, 0, 16))
- resizeTopLeft = createResizeHandle("ResizeTopLeft", UDim2.new(0, -8, 0, -8), UDim2.new(0, 16, 0, 16))
- DraggingSystem.MakeDraggable(mainFrame, titleBar, {
- OnClick = function() end
- })
- ResizeSystem.MakeResizable(mainFrame, resizeRight, {})
- ResizeSystem.MakeResizable(mainFrame, resizeLeft, {})
- ResizeSystem.MakeResizable(mainFrame, resizeBottom, {})
- ResizeSystem.MakeResizable(mainFrame, resizeTop, {})
- ResizeSystem.MakeResizable(mainFrame, resizeBottomRight, {})
- ResizeSystem.MakeResizable(mainFrame, resizeBottomLeft, {})
- ResizeSystem.MakeResizable(mainFrame, resizeTopRight, {})
- ResizeSystem.MakeResizable(mainFrame, resizeTopLeft, {})
- function addLog(message, color, messageType)
- logFrame = Instance.new("Frame")
- logFrame.Size = UDim2.new(1, -10, 0, 0)
- logFrame.BackgroundTransparency = 1
- logFrame.AutomaticSize = Enum.AutomaticSize.Y
- logFrame.Parent = logContainer
- iconLabel = Instance.new("ImageLabel")
- iconLabel.Size = UDim2.new(0, 20, 0, 20)
- iconLabel.Position = UDim2.new(0, 0, 0, 2)
- iconLabel.BackgroundTransparency = 1
- iconLabel.Parent = logFrame
- if messageType == Enum.MessageType.MessageError then
- iconLabel.Image = "rbxasset://textures/DevConsole/Error.png"
- elseif messageType == Enum.MessageType.MessageWarning then
- iconLabel.Image = "rbxasset://textures/DevConsole/Warning.png"
- else
- iconLabel.Image = "rbxasset://textures/DevConsole/Info.png"
- end
- textLabel = Instance.new("TextLabel")
- textLabel.Size = UDim2.new(1, -75, 0, 0)
- textLabel.Position = UDim2.new(0, 25, 0, 0)
- textLabel.BackgroundTransparency = 1
- textLabel.Text = message
- textLabel.TextColor3 = color
- textLabel.Font = Enum.Font.Code
- textLabel.TextSize = textSize
- textLabel.TextWrapped = true
- textLabel.TextXAlignment = Enum.TextXAlignment.Left
- textLabel.AutomaticSize = Enum.AutomaticSize.Y
- textLabel.Parent = logFrame
- copyBtn = Instance.new("TextButton")
- copyBtn.Size = UDim2.new(0, 45, 0, 20)
- copyBtn.Position = UDim2.new(1, -45, 0, 0)
- copyBtn.BackgroundColor3 = Color3.fromRGB(50, 50, 60)
- copyBtn.BackgroundTransparency = 0.2
- copyBtn.Text = "Copy"
- copyBtn.TextColor3 = Color3.fromRGB(200, 200, 200)
- copyBtn.Font = Enum.Font.Gotham
- copyBtn.TextSize = 10
- copyBtn.Parent = logFrame
- Instance.new("UICorner", copyBtn).CornerRadius = UDim.new(0, 4)
- copyBtn.MouseButton1Click:Connect(function()
- if setclipboard then
- setclipboard(message)
- copyBtn.Text = "Done!"
- task.wait(1)
- copyBtn.Text = "Copy"
- end
- end)
- if autoScroll then
- task.wait(0.03)
- logContainer.CanvasPosition = Vector2.new(0, logContainer.AbsoluteCanvasSize.Y)
- end
- updateScrollability()
- end
- autoScrollBtn.MouseButton1Click:Connect(function()
- autoScroll = not autoScroll
- autoScrollBtn.Text = "Scroll: " .. (autoScroll and "ON" or "OFF")
- autoScrollBtn.BackgroundColor3 = autoScroll and Color3.fromRGB(60, 100, 180) or Color3.fromRGB(100, 100, 110)
- end)
- clearBtn.MouseButton1Click:Connect(function()
- for _, child in ipairs(logContainer:GetChildren()) do
- if child:IsA("Frame") then child:Destroy() end
- end
- updateScrollability()
- end)
- copyAllBtn.MouseButton1Click:Connect(function()
- allLogs = {}
- for _, child in ipairs(logContainer:GetChildren()) do
- if child:IsA("Frame") and child:FindFirstChild("TextLabel") then
- table.insert(allLogs, child.TextLabel.Text)
- end
- end
- if setclipboard then setclipboard(table.concat(allLogs, "\n")) end
- end)
- closeBtn.MouseButton1Click:Connect(function() screenGui.Enabled = false end)
- UserInputService.InputBegan:Connect(function(input, gpe)
- if not gpe and input.KeyCode == Enum.KeyCode.F2 then
- screenGui.Enabled = not screenGui.Enabled
- end
- end)
- LogService.MessageOut:Connect(function(message, messageType)
- color = Color3.fromRGB(220, 220, 220)
- if messageType == Enum.MessageType.MessageError then
- color = Color3.fromRGB(255, 100, 100)
- elseif messageType == Enum.MessageType.MessageWarning then
- color = Color3.fromRGB(255, 200, 100)
- end
- addLog(string.format("[%s] %s", os.date("%H:%M:%S"), message), color, messageType)
- end)
- updateScrollability()
Advertisement