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

Why doesn't my Visible = true/false not work?? (open/close gui)

I'm a beginner scripter, and I'm having some problems with just one very simple function.

Here is my script, and somehow every time I test it out and click the open button, my text label doesn't appear.

Button:

Text = game.StarterGui.ScreenGui.TextLabel
script.Parent.MouseButton1Click:connect (function()
	Text.Visible = not Text.Visible
end)

Please don't criticize the script i made above, because I just started scripting ;)

All answers are appreciated!

Thanks!

1 comment

0

Also, when i test and click the button, on properties the visible changes, but it doesnt show in game

2 answers

You wouldn't change what is on the StarterGui. Each player has their own gui called the "PlayerGui", and the game replicates what is on the startergui to the player's gui.

Put this in a LocalScript inside the TextLabel.

local Text = script.Parent
Text.MouseButton1Click:Connect(function()
    Text.Visible = not Text.Visible
end)

1 comment

0

Thank you! :D

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