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

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

Asked by
awfulszn 394 Moderation Voter
8 years ago

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

Log in to vote
0
Answered by 8 years ago
 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."

0
I want the text to do one letter at a time with 0.2 seconds in between though. :c awfulszn 394 — 8y
0
Never mind that worked! Thank you! awfulszn 394 — 8y
Ad

Answer this question