Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make text on a Surface/ScreenGUI animate so it looks like it is typing itself out?

Hello! Im currently wondering how you make a text animation that looks like its typing itself out. I don't have any scirpts to share since I have no clue how to start.

1 answer

✓ Accepted answer

There are a few ways, you can do it from nothing and keep changing the text, but that's lots of work, or you could use some string stuff and loops :)

You would need to use string.len and string.sub like you can see in the example below

local sentence = 'I like programming with roblox studio :)' -- The thing you want it to type out
local label = script.Parent -- Your textlabel

local len = string.len(sentence) -- It gets the lenght of your string


repeat -- Isn't neccesary, it just makes it so it loops
	wait() -- pretty neccesary if you don't want your studio to crash xD
	n = 0 -- Sets n (position) to 0
	repeat -- Loop is neccesary if you don't want it to do manually
		wait(0.2) -- Waittime
		n = n + 1 -- Add to position with 1
		label.Text = string.sub(sentence,1,n) -- Sets the text using string.sub
	until n >= len -- Waits for the lenght to be the same as the position
until false

You could also add a sound if you want, a good one is https://www.roblox.com/library/172065335/typewriter-key-1

Edit for mouseclick :)

14 comments

0

I added how to script works using comments inside the script, you should also ready the wiki about this here https://wiki.roblox.com/index.php?title=Global_namespace/String_manipulation. :)

0

Thank you :D

0

Np :)

0

How do I stop the repeat?

0

What do you mean?, You can remove the first repeat and the until false at the end if that's what you mean

0

No, if I do that it only spells out the first letter :| because im doing it with a click of a TextButton on a SurfaceGUI

0

Just the first loop, not both?

0

I'll edit the script for you, wait a sec

0

Wait a sec, are you using a billboardgui then?

0

Im using SurfaceGui

0

Then it should just be the second repeat that you need

0

This works, nice!

0

How do I program the sound into the Type Animation?

0

after the wait(0.2) do Effect:Play(), you should add a sound somewhere next to the script and do something like this local Effect = script.Parent:WaitForChild('Sound') and don't set the sound to playing

This discussion is preserved as it was. New answers, comments, and votes are closed.