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

How do I make text on a Gui dissappear?

Asked by
Peeshavee 226 Moderation Voter
8 years ago

What I mean is I have this script which runs a few lines of text, but when it finishes, the last piece of text stays. Here's the code:

01local part = script.Parent
02local db = false
03local myVar = game.Workspace.Part.SurfaceGui.Test
04 
05function FindHat(hit)
06    local hat = hit.Parent:FindFirstChild("SilverthornAntlers")
07    local human = hit.Parent:FindFirstChild("Humanoid")
08    if human and hat then
09        if not db then
10            db = true
11 
12        myVar.Text = ("HOW DARE YOU WEAR THAT WRETCHED HAT!?")
13        wait(4)
14        myVar.Text = ("YOU WILL BE SMITED BY MY WRATH!")
15        wait(4)
View all 30 lines...

At the part where it says "DIE", my character dies, which is what I want it to do, but after, the "DIE" part stays on the Gui. Anyway to fix this?

1 answer

Log in to vote
0
Answered by 8 years ago

You could hide the element:

myVar.Visible = false

or simply clear the text:

myVar.Text = ""

Ad

Answer this question