Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Customize these values to change the appearance of the console
- local BACKGROUND_COLOR = Color3.new(0, 0, 0)
- local TEXT_COLOR = Color3.new(1, 1, 1)
- local FONT_SIZE = 18
- -- Create a ScreenGui to hold the console output
- local ConsoleGui = Instance.new("ScreenGui")
- ConsoleGui.Name = "Console"
- ConsoleGui.Enabled = true
- ConsoleGui.ResetOnSpawn = false
- ConsoleGui.Parent = game.CoreGui
- -- Create a Frame to hold the console output
- local ConsoleFrame = Instance.new("Frame")
- ConsoleFrame.Name = "ConsoleFrame"
- ConsoleFrame.Size = UDim2.new(0.5, 0, 0.5, 0)
- ConsoleFrame.Position = UDim2.new(0.25, 0, 0.25, 0)
- ConsoleFrame.BackgroundTransparency = 0.5
- ConsoleFrame.BackgroundColor3 = BACKGROUND_COLOR
- ConsoleFrame.BorderColor3 = TEXT_COLOR
- ConsoleFrame.BorderSizePixel = 5
- ConsoleFrame.Parent = ConsoleGui
- -- Create a TextLabel to display the console output
- local ConsoleOutput = Instance.new("TextLabel")
- ConsoleOutput.Name = "ConsoleOutput"
- ConsoleOutput.Size = UDim2.new(1, 0, 1, 0)
- ConsoleOutput.BackgroundTransparency = 1
- ConsoleOutput.Font = Enum.Font.SourceSans
- ConsoleOutput.TextColor3 = TEXT_COLOR
- ConsoleOutput.TextSize = FONT_SIZE
- ConsoleOutput.TextWrapped = true
- ConsoleOutput.Parent = ConsoleFrame
- -- Redirect print, warn, and error to update the TextLabel
- local function updateConsoleOutput(msg, color)
- ConsoleOutput.Text = ConsoleOutput.Text .. msg .. "\n"
- ConsoleOutput.TextColor3 = color or TEXT_COLOR
- end
- print = function(msg)
- updateConsoleOutput("[INFO]: " .. msg, TEXT_COLOR)
- end
- warn = function(msg)
- updateConsoleOutput("[WARNING]: " .. msg, Color3.new(1, 1, 0))
- end
- error = function(msg)
- updateConsoleOutput("[ERROR]: " .. msg, Color3.new(1, 0, 0))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement