Roblox has released an in-built Typewriter. Use that instead of this. This module is now discontinued.
Introduction
There are not many Typewriter modules found in the Developer Forum, especially those that work with RichText property.
So after seeing different posts scattered across different threads asking how to create a typewriter effect with RichText, and a lack of typewriter modules, I decided to try to make one myself.
Here is the result:
Preview
Code
local Typewriter = require(workspace.Typewriter)
local Typer = Typewriter.new()
wait(5)
Typer.OnTextUpdated:Connect(function(current_text)
game.StarterGui.ScreenGui.TextLabel.Text = current_text
end)
Typer.OnTyperFinished:Connect(function(final_text)
print("Completed typing the text!")
end)
Typer:TypeText([[
<font size="40"><b>About the Community Resources category</b></font>
This category is where you can find free resources that are useful for development on Roblox.
Only post <b>significant</b> resources that you created yourself, or resources that you found off-Roblox that are useful to the Roblox developer community. <b>Do not post other users' Roblox creations and resources in this category.</b> You may only post resources you have not created if they do not come from Roblox.
Only post resources with a substantial <b>free or open-source</b> component here (<b>code must be open-source</b>). Post <b>paid or closed-source</b> service subscriptions, plugins, and other resources in <b>#help-and-feedback:cool-creations</b> instead.
<font size="30"><b>How should I write my resource topics?</b></font>
Your resource must be:
- <b>Related to Roblox development.</b>
- <b>Well explained</b>; do not dump content here, you must explain how your resource is meant to be used.
- <b>Significant overall</b>; your contributions must be more substantial than small scripts or a few individual assets. Resources that are not significant enough, too specific / not useful to many people, or too low quality should be posted in a different forum category, or you should request help from <b>@Community_Editor</b> to learn what can be improved.
Things you could post a Community Resources thread about:
- Significant ModuleScripts, code libraries, or frameworks that you created for public use.
- Large collections of assets / free models that you created for public use.
- Royalty-free art, audio, or texture resources.
- Free plugins you wish to showcase.
- Websites that are useful to Roblox development.
Use the <font color="rgb(0,213,255)">Community Tutorials</font> category if your topic explains how to achieve something, rather than just provides and explains a resource.
]],0.03,true,false)
Make sure the formatting of the RichText is 100% correct or the script may error or glitch out.
You can have complicated RichText with this but I recommend not going too crazy with it, again make sure all the formatting is 100% correct I have not added any error detection system whatsoever.
To be notified of any changes that take place in this module, or if you are using this module in your game, it is recommended to set the following topic to Watching:
A few bug fixes. It is recommended to update your module to the latest version. Report any bugs that occur. It is also recommended to set this topic to âWatchingâ if you are using this module in your game.
As suggested by LucasTutoriaisSaimo, a bulletin board topic has been made, all future updates will be posted there, you now no longer have to keep this topic as âWatchingâ.
Thank you so much! This module is amazing! I have a suggestion though, could you please add an option for a custom sound the user chooses to play when the text starts writing, and also âtext animationâ parameter in the Typer:TypeText, that makes the typewriter text have a preset text animation you made if you write that animationâs name in the function (example: typer:TypeText(text,interval,rich_text_enabled,animation name (wiggling text/shaking text/etc),yield)?
(because i know i suck at explaining things, hereâs a video recorded in the game Undertale that shows what im talking about)
Thatâs what Typer.OnTextUpdated event is for, to have a custom implementation of each typewriter effect. You can play a sound in the event by doing Sound:Play(), and for shaky text you can implement that yourself in the event as well. But because of the current limitations of text labels, it is a bit difficult to implement.
Is there any stable way to add AdjustSpeed on a certain point of the text or character?
I canât find an example but this should be explanatory.
âHello, Player! (Pauses for a while ) are you a boy or a girl? or maybe a part of the (AdjustSpeed to 0.01) Flag community?â
So basically like functions after a certain part of the text is shown, Iâve tried making a loop that does this, it goes like
repeat service.Heartbeat:wait() until
Text == "Hello Player! "
end
:pause
but sometimes itâs not reliable, is there a more flexible or better way of doing this?