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

Why is won't this gui reappear after I set it's visibility to true?

GuiText = game.StarterGui.ScreenGui.TextBox
GuiText.Visible = false
game.Workspace.GUIPart.SurfaceGui.TextButton.MouseButton1Click:Connect(function()
game.StarterGui.ScreenGui.TextBox.Visible = true
end)

The Gui will disappear like it should but will not reappear when the TextButton is clicked.

4 comments

0

Is this a local script?

0

No.

0

Try making it a local script.

0

I did.

1 answer

✓ Accepted answer

Ok, I'm going to make some assumptions here since you didn't give all the information needed. So I'm going to assume that this is a local script.

The reason this wouldn't work is because you are using the starter gui and not the player gui. The reason to use the player gui is because it is a child of the player and everything in the starter gui initially when a player joins is cloned into each player's player gui

So i think this might solve your problems:

local GuiText = game.Players.LocalPlayer:WaitForChild("PlayerGui").ScreenGui.TextBox
GuiText.Visible = false
game.Workspace.GUIPart.SurfaceGui.TextButton.MouseButton1Click:Connect(function()
	GuiText.Visible = true
end)

5 comments

0

oh, so it isn't a local script

0

you might want to make it a local script

0

Could I ask a question, where did you learn to script theking48989987?

0

roblox wiki and youtube mostly

0

also sometimes looking at how others do things

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