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

How do I make Billboardgui Disappear?

Asked by 6 years ago

I want it to either be destroyed or 1 transparency, but I don't know how so, all I know was doing it on the parts.

3 answers

Log in to vote
0
Answered by 6 years ago

Well it depends on whether you have the script in the surfacegui or in a textlabel/button inside the surfacegui. But either way, you would use destroy. Like so:

script.Parent.Parent:Destroy()
0
Welp, beat me to it for the fastest answer but at least mine has two answers. User#18043 95 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Use this method :Destroy(), it destroys whatever you want to set to nil.

If you instead want to keep it for later instead of destroying it. You can set it to invisible.

.Visible = false

and then set it back again.

.Visible = true

1
Don't use remove. It's deprecated. Azarth 3141 — 6y
1
Remove does not work the same. Destroy moves the object to nil, prepares it for garbage collection and calls Destroy on it's children. Remove parents it to nil and calls Remove on it's children, but does not prepare garbage collection. Thundermaker300 554 — 6y
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

The easiest way to make your BillboardGui to dissapear would be either to put your contents within a Frame, and set the Frame property Visible to false:

script.Parent.BillboardGui.Frame.Visible = false

Or, you could use the Enabledproperty:

script.Parent.BillboardGui.Enabled = false --disable it
script.Parent.BillboardGui.Enabled = true --enable it

Or you could just use the Destroy event.

script.Parent.BillboardGui:Destroy()

If this helped, please upvote and accept my answer!

Answer this question