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

My text label doesn't add text automatically and doesn't close automatically after text?

What I want is, when I click my button, the GUI pops up (Which it does) but the text does not appear, and after the text I want the GUI to automatically close. Here is the script:

local p = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
	game.ReplicatedStorage.Cheezburger:Clone().Parent = p.Backpack
	script.Parent.Parent.Parent.Waiter.ImageLabel.Visible = true
	script.Parent.Parent.Parent.Waiter.Frame.TextLabel.Visible = true
	script.Parent.Parent.Parent.Waiter.Frame.Visible = true
	
	wait(1)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "E"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "En"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enj"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjo"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjoy"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjoy Y"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjoy Yo"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjoy You"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjoy Your"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjoy Your M"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjoy Your Me"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjoy Your Mea"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjoy Your Meal"
	wait(0.2)
	game.StarterGui.Waiter.Frame.TextLabel.Text = "Enjoy Your Meal!"
	wait(3)
	game.StarterGui.Waiter.ImageLabel.Visible = false
	game.StarterGui.Waiter.Frame.TextLabel.Visible = false
	game.StarterGui.Waiter.Frame = false
end)

There are no errors in the console. Hope you can help! :)

1 answer

✓ Accepted answer
 game.>>>StarterGui<<<.Waiter.Frame.TextLabel.Text = "Enjoy Your Meal!"

The reason it isn't closing is because you are accessing the StarterGui which clones a gui into a players PlayerGui, you need to get the LocalPlayer's (if in a local script which it is) PlayerGui.

So really just swap all "game.StarterGui" ' s with "p.PlayerGui."

2 comments

0

I want the text to do one letter at a time with 0.2 seconds in between though. :c

0

Never mind that worked! Thank you!

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