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

How do I give a TextLabel in a ScreenGui a typewriter effect?

It's obvious you can do this by doing:

	script.Parent.Parent.Dialog.TextLabel.Text="H"
	wait(0.05)
	script.Parent.Parent.Dialog.TextLabel.Text="He"
	wait(0.05)
	script.Parent.Parent.Dialog.TextLabel.Text="Hel"
	wait(0.05)
	script.Parent.Parent.Dialog.TextLabel.Text="Hell"
	wait(0.05)
	script.Parent.Parent.Dialog.TextLabel.Text="Hello"
	wait(0.05)
	script.Parent.Parent.Dialog.TextLabel.Text="Hello."

But I just want a simple function I can put my text into so that it does what I want easily.

4 answers

It's actually really simple, try this :)

local text = "Whatever text you want this to be"

for i = 1, #text do
	script.Parent.Parent.Dialog.TextLabel.Text = string.sub(text, 1, i)
	wait(0.04) --This is the speed of the text
end

1 comment

0

how do i get to there

Put the individual characters you want typed into the table called Words

local Words = {"H","e'","l","l","o","."}

local function Type()
	for i,v in pairs(Words[i]) do
		wait(0.05)
		script.Parent.Parent.Dialog.TextLabel.Text=script.Parent.Parent.Dialog.TextLabel.Text..v
	end
end

Type()

Press view source to see the entirety of line 6, it's pretty long.

5 comments

0

honestly sad man

0

lmfao

0

LOL

0

i was trying to do it for like a coin gui i have when it updates it want it to update like that

0

That'll work, but there are MUCH better ways to do it than that!!!! LOL

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