Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

How do I disable a TextLabel once it's been enabled?

Asked by 3 years ago

I tried doing it with this:

game.StarterGui.ScreenGui.TextLabel.Visible = false

Didn't work. I tried doing things more extremely.

game.StarterGui.ScreenGui.TextLabel:Destroy()

Then I resorted to this.

game.StarterGui.ScreenGui:Destroy()

And it still didn't work. Please send help.

1 answer

Log in to vote
1
Answered by 3 years ago

StarterGui and PlayerGui are different.

Read this article for more information.

If you're using a Local Script, "which you should be", then get the Local Player and then you can do the rest rather easy.

--Local Script
local plr = game.Players.LocalPlayer
plr.PlayerGui.ScreenGui.TextLabel.Visible = false
Remember that Local Scripts only work in certain places and services. I would recommend using StarterGui to house this Local Script. Other options would include ReplicatedFirst, StarterPack, StarterCharacterScripts, and StarterPlayerScripts, as well as a few more.

Good Luck!

If I helped, please don't forget to accept my answer.
0
Thank you, ma'am. Correct me if I'm wrong, but this isn't the first time you have helped me. Thank you for all the help. Rodmane234 85 — 3y
Ad

Answer this question