Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- GUI作成
- local ScreenGui = Instance.new("ScreenGui")
- local ConsoleFrame = Instance.new("Frame")
- local TabFrame = Instance.new("Frame")
- local MinimizeButton = Instance.new("TextButton")
- local CloseButton = Instance.new("TextButton")
- local MessageContainer = Instance.new("ScrollingFrame")
- local UIListLayout = Instance.new("UIListLayout")
- -- GUIプロパティの設定
- ScreenGui.Name = "CustomConsole"
- ScreenGui.ResetOnSpawn = false
- ConsoleFrame.Name = "ConsoleFrame"
- ConsoleFrame.Size = UDim2.new(0, 400, 0, 300)
- ConsoleFrame.Position = UDim2.new(0.5, -200, 0.5, -150)
- ConsoleFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- ConsoleFrame.BorderSizePixel = 0
- ConsoleFrame.Active = true
- ConsoleFrame.Draggable = false -- ドラッグはスクリプトで制御
- TabFrame.Name = "TabFrame"
- TabFrame.Size = UDim2.new(1, 0, 0, 30)
- TabFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- TabFrame.BorderSizePixel = 0
- MinimizeButton.Name = "MinimizeButton"
- MinimizeButton.Size = UDim2.new(0, 50, 1, 0)
- MinimizeButton.Position = UDim2.new(1, -100, 0, 0)
- MinimizeButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- MinimizeButton.Text = "_"
- CloseButton.Name = "CloseButton"
- CloseButton.Size = UDim2.new(0, 50, 1, 0)
- CloseButton.Position = UDim2.new(1, -50, 0, 0)
- CloseButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- CloseButton.Text = "X"
- MessageContainer.Name = "MessageContainer"
- MessageContainer.Size = UDim2.new(1, 0, 1, -30)
- MessageContainer.Position = UDim2.new(0, 0, 0, 30)
- MessageContainer.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
- MessageContainer.BorderSizePixel = 0
- MessageContainer.CanvasSize = UDim2.new(0, 0, 0, 0)
- MessageContainer.ScrollBarThickness = 8
- UIListLayout.Padding = UDim.new(0, 5)
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- -- メッセージ管理
- local messages = {}
- local function addMessage(message, messageType)
- for _, msg in pairs(messages) do
- if msg.text == message then
- msg.count = msg.count + 1
- msg.label.Text = message .. " × " .. msg.count
- return
- end
- end
- local newMessage = {
- text = message,
- count = 1,
- label = Instance.new("TextLabel")
- }
- newMessage.label.Text = message
- newMessage.label.Parent = MessageContainer
- table.insert(messages, newMessage)
- end
- -- メッセージの種類フィルタリング
- local function filterMessages(filterType)
- for _, msg in pairs(messages) do
- msg.label.Visible = (msg.type == filterType or filterType == "All")
- end
- end
- -- GUIの移動可能設定
- local dragging, dragStart, startPos
- ConsoleFrame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = ConsoleFrame.Position
- end
- end)
- ConsoleFrame.InputChanged:Connect(function(input)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- local delta = input.Position - dragStart
- ConsoleFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end)
- ConsoleFrame.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false
- end
- end)
- -- タブ機能
- MinimizeButton.MouseButton1Click:Connect(function()
- MessageContainer.Visible = not MessageContainer.Visible
- end)
- CloseButton.MouseButton1Click:Connect(function()
- ScreenGui:Destroy()
- end)
- -- メッセージ出力のフック
- local originalPrint = print
- print = function(...)
- local args = {...}
- local message = table.concat(args, " ")
- addMessage(message, "Message")
- originalPrint(message)
- end
- -- GUIの親設定
- ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- ConsoleFrame.Parent = ScreenGui
- TabFrame.Parent = ConsoleFrame
- MinimizeButton.Parent = TabFrame
- CloseButton.Parent = TabFrame
- MessageContainer.Parent = ConsoleFrame
- UIListLayout.Parent = MessageContainer
Advertisement
Add Comment
Please, Sign In to add comment