Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago
01--Variables
02local speech = script.Parent.Speech
03 
04--Test
05workspace.TestClick.ClickDetector.MouseClick:Connect(function()
06 
07    speech.Text = "H"
08    wait(0.03)
09    speech.Text = "He"
10    wait(0.03)
11    speech.Text = "Hel"
12    wait(0.03)
13    speech.Text = "Hell"
14    wait(0.03)
15    speech.Text = "Hello"
16 
17end)

Or do I have to type all of this out?

2 answers

Log in to vote
1
Answered by 6 years ago

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

01-- Variables
02 
03local speech = script.Parent.Speech
04TextToType="Hello"
05 
06-- Code
07 
08workspace.TestClick.ClickDetector.MouseClick:Connect(function()
09    for i=1,#TextToType do
10        speech.Text = string.sub(TextToType,1,i)
11    end
12end)

Hope this helped <3

0
this is so much more useful! Tysm VeryDarkDev 47 — 6y
0
:D OkxieCorey 125 — 6y
Ad
Log in to vote
-1
Answered by 6 years ago
Edited 6 years ago

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

01--Variables
02 
03local text = "Hello"
04local speech = script.Parent.Speech
05 
06--Code
07 
08workspace.TestClick.ClickDetector.MouseClick:Connect(function()
09    for i = 1, #text do
10        wait(.05) --change the wait to make the typewriting effect slower/faster
11        speech.Text = string.sub(text, 1, i)
12    end
13end)
0
All you did was copy the first answer... User#19524 175 — 6y
0
All you did was copy my answer. :P OkxieCorey 125 — 6y

Answer this question