[Supports RichText] Typewriter Module

UPDATE:

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.

Documentation

Discontinued

Installation

https://www.roblox.com/library/6145860886

Updates

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:

52 Likes

Is there a way to speed up and slow down the typewriter in this documentation?

Good release, I could see myself using this for AI dialog.

1 Like

Previous Update

Update

The module has been heavily updated. Please update the module in your game and change the functions to make them work with the changes.

Added:

Typer:IsTyping()
Typer:Pause()
Typer:Unpause()
Typer:AdjustSpeed(interval)
Typer.OnTyperFinished:Connect()

Changed:

Typer:Connect() is now Typer.OnTextUpdated:Connect().

Removed:

Typer:DisconnectAll() has been removed.

11 Likes

Previous Update

Update

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.

2 Likes

You should have something in #bulletin-board for your module which THEN gets followed by the users; so that replies don’t get annoying.

4 Likes

Previous Update

Update

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)

1 Like

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.

1 Like

Update:

Roblox has released an in-built Typewriter. Use that instead of this. This module is now discontinued.

2 Likes

this looks easier to use than roblox’s upcoming typewriter effect
%100 using this for upcoming projects

1 Like

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?

1 Like