Hi,
I have a debug brick for my testers and I want the message to stack if it is the same as the previous output message.
Here’s the visual problem:
See how the output stacks but the custom one doesn’t.
Local Script:
--[ Services ]--
local LogService = game:GetService("LogService")
local SurfaceGUI = workspace.PublicConsole.SurfaceGui
local ScrollingFrame = SurfaceGUI.ScrollingFrame
--[ Settings ]--
MAX_CHARACTERS = nil -- max characters before it auto scales the text (the text size will change)
TEXT_SIZE = 80
function CreateMessage(Message: string,MessageType)
local TextLabel = Instance.new("TextLabel")
TextLabel.BackgroundTransparency = 1
if MessageType == Enum.MessageType.MessageWarning then
TextLabel.TextColor = BrickColor.new("Yellow flip/flop")
end
if MessageType == Enum.MessageType.MessageOutput then
TextLabel.TextColor = BrickColor.new("White")
end
if MessageType == Enum.MessageType.MessageError then
TextLabel.TextColor = BrickColor.new("Red flip/flop")
end
if MessageType == Enum.MessageType.MessageInfo then
TextLabel.TextColor = BrickColor.new("Baby blue")
end
TextLabel.AnchorPoint = Vector2.new(0.5,0.5)
TextLabel.Size = UDim2.new(0.98, 0,0, 100)
TextLabel.Font = Enum.Font.GothamSemibold
TextLabel.Text = "▶ Console - "..Message
TextLabel.TextSize = TEXT_SIZE
if MAX_CHARACTERS then
if string.len(TextLabel.Text) <= MAX_CHARACTERS then
TextLabel.TextSize = TEXT_SIZE
else
TextLabel.TextScaled = true
end
end
TextLabel.TextXAlignment = Enum.TextXAlignment.Left
TextLabel.Parent = ScrollingFrame
end
LogService.MessageOut:Connect(function(Message: string,MessageType)
CreateMessage(Message,MessageType)
end)