Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 5 years ago
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.

0
Is this a local script? Darkcraft10 20 — 5y
0
No. Gameplay28 139 — 5y
0
Try making it a local script. Darkcraft10 20 — 5y
0
I did. Gameplay28 139 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)
0
oh, so it isn't a local script theking48989987 2147 — 5y
0
you might want to make it a local script theking48989987 2147 — 5y
0
Could I ask a question, where did you learn to script theking48989987? Darkcraft10 20 — 5y
0
roblox wiki and youtube mostly theking48989987 2147 — 5y
0
also sometimes looking at how others do things theking48989987 2147 — 5y
Ad

Answer this question