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

GUI text doesn't function properly?

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

✓ Accepted answer

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.

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 = ""

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