Hello! I hope you are having a great day! I had a great day raging at some of the games in the Metaverse event!
However thats not the point. I have a little problem.
script.Parent.Text = 'Hello! I am <font color="#FFA500">Haran</font>. What is your name?'
local amountOfText = string.len(script.Parent.Text)
for i = 1, amountOfText do
script.Parent.MaxVisibleGraphemes = i
wait(0.01)
script.Parent.Parent.Parent.ChatSound:Play()
end
So a sound plays whenever the text gets typed. I want to use Roblox’s new Typewritter system, but since I am using RichText, the sound plays extra amount of times.
If you can help, please let me know. Thanks! WE
P.S. I don’t want to use a fancy module anymore. I just want to keep it simple.
If your trying to make a typewriting effect do this:
local text = "what ever you want"
local textLabel = script.Parent
for digit = 1, #text do
textLabel.Text = string.sub(text,1,digit)
wait(0.1) -- Time per character typed.
end
The link you posted has an example that can remove RichText tags for you
local text = 'Hello! I am <font color="#FFA500">Haran</font>. What is your name?'
local function removeTags(str)
str = str:gsub("<br%s*/>", "\n")
return (str:gsub("<[^<>]->", ""))
end
local displayText = removeTags(text)
print(displayText)
You can make a variable containing the same text but without any tags. Then apply the one with tags to the text but loop through the one without tags and play the type sound.