Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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.

1 comment

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.