Hello!
I was trying to typewrite a label which includes richtext. This turned out to be an issue when it typewrites the progression of the Richtext in the script. Example: it typewrites this; <font color='rgb(255, 0, 0)'><b>it</b></font>
Here’s the code:
local label = script.Parent
label.RichText = true
local function typewrite(object,text,length)
for i = 1,#text,1 do
local sound = Instance.new("Sound")
sound.Parent = game.Workspace
sound.SoundId = "rbxassetid://9120299506"
sound.Name = "DialogSound"
sound:Play()
object.Text = string.sub(text,1,i)
wait(length)
end
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "DialogSound" then
v:Destroy()
end
end
end
typewrite(script.Parent, "Objective: Flash your camera when you see <font color='rgb(255, 0, 0)'><b>it</b></font>.", 0.05)
I hope there is a way to solve this. Thank you so much for your help!
Edit: I forgot to include, after typewriting the whole progression, it turns red and bolded as i wanted. The only problem is that it shows the < bold, color > thing. THanks