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

GUI text doesn't function properly?

Asked by 10 years ago
while true do
    local text = "Welcome to Forever Build 2014!"
    for i = 1, #text do
    script.Parent.Text = script.Parent.Text..text:sub(i,i)
    wait(.1)
    end
    wait(5)
    local text = "This place last updated on July 12."
    for i = 1, #text do
    script.Parent.Text = script.Parent.Text..text:sub(i,i)
    wait(.1)
    end
    wait(5)
    local text = "Now there are two spawn points! Build on different sides of the map!"
    for i = 1, #text do
    script.Parent.Text = script.Parent.Text..text:sub(i,i)
    wait(.1)
    end
    wait(5)
    local text = "We hope you enjoy your experience! Have fun building!"
    for i = 1, #text do
    script.Parent.Text = script.Parent.Text..text:sub(i,i)
    wait(.1)
    end
    wait(5)
    local text = "Credit for the amazing Build v3.1.0 tool goes to kasuku. His tool makes your building experience possible!"
    for i = 1, #text do
    script.Parent.Text = script.Parent.Text..text:sub(i,i)
    wait(.1)
    end
    wait(5)
end

This script makes text appear in individual letters, like so:

H

He

Hel

Hell

Hello

However, when the wait(5) passes, instead of getting rid of the old text, it builds upon it, like so:

Hello

HelloH

HelloHe

HelloHel

HelloHell

HelloHello

Also, I think the script is a bit inefficient. Any way to fix this?

3 answers

Log in to vote
0
Answered by 10 years ago

Since I am still learning the string stuff, the only problem that I can see is that after each wait(.1) you didn't put

script.Parent.Text = ''

to erase what the text was before!

I hope this helped.

Ad
Log in to vote
0
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago

Darkness is pretty close to the right trail, except it's after every wait(5) you want to add the below script to erase previous text.

script.Parent.Text = ""
Log in to vote
-1
Answered by 10 years ago

Do text:Destroy()

Answer this question