-
What do you want to achieve?
I’m trying to create a pseudo-code block withstring.match
and the RichText beta feature. -
What is the issue?
Thestring.match
function doesn’t work, and I know it’s something related to that and not the function since it works completely fine without that part. -
What solutions have you tried so far?
I’ve looked all over the devhub, I’ve scoured the forums here, and still nothing. I tried asking other people in some Discord servers about it and they don’t have an answer either. I’ve tried making separate labels for that, but I figured it would take way too long and would be way too tedious. There aren’t any errors either.
Here’s the code:
local console = script.Parent.BackgroundConsole
local out = script.Parent.BackgroundOutput
local gui = script.Parent
console.Input.FocusLost:Connect(function()
local temp = game:GetService("ReplicatedStorage"):WaitForChild("tempDefault"):Clone()
local printM = string.match(console.Input.Text, "print")
local text = console.Input.Text
if printM then
local TargetMessage = string.sub(text, 6)
temp.Arrow.Font = Enum.Font.SourceSansItalic
temp.Arrow.TextColor3 = Color3.fromRGB(117, 202, 255)
temp.Arrow.Text = 'PRINT'
temp.Message.Text = '("'.. TargetMessage.. '")'
else
temp.Parent = console.Holder
temp.Message.Text = text
end
end)
The problem in action:
https://gyazo.com/516bb40b67d552298cf1136815c60bad
It’s my first post here, so I’m sorry if I missed anything.