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.
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()
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
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 Enabled
property:
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!