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

Is there a more efficient way of making a self typing speech bubble?

--Variables
local speech = script.Parent.Speech

--Test
workspace.TestClick.ClickDetector.MouseClick:Connect(function()
	
	speech.Text = "H"
	wait(0.03)
	speech.Text = "He"
	wait(0.03)
	speech.Text = "Hel"
	wait(0.03)
	speech.Text = "Hell"
	wait(0.03)
	speech.Text = "Hello"
	
end)

Or do I have to type all of this out?

2 answers

✓ Accepted answer

No, you would not have to type this all out, simply copy the script below!

-- Variables

local speech = script.Parent.Speech
TextToType="Hello"

-- Code

workspace.TestClick.ClickDetector.MouseClick:Connect(function()
	for i=1,#TextToType do
		speech.Text = string.sub(TextToType,1,i)
	end
end)

Hope this helped <3

2 comments

0

this is so much more useful! Tysm

0

:D

No, you would not have to type this all out! I call this the "Typewriting effect".

--Variables

local text = "Hello"
local speech = script.Parent.Speech

--Code

workspace.TestClick.ClickDetector.MouseClick:Connect(function()
	for i = 1, #text do
		wait(.05) --change the wait to make the typewriting effect slower/faster
		speech.Text = string.sub(text, 1, i)
	end
end)

2 comments

0

All you did was copy the first answer...

0

All you did was copy my answer. :P

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