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 make a button that goes invisible then shows a different GUI when clicked?

TeamGUI is the GUI to show if you click the button

local (TeamGUI) = game.Players.LocalPlayer.PlayerGui:WaitForChild("TeamGUI") local button = script.Parent.TextButton

button.MouseButton1Click:Connect(function()) (TeamGUI).Enabled = true end)

2 comments

0

You didn't format it correctly, please look at the guidelines and also how to make a good question.

0

You didnt format it as in you never even formatted it as a lua script, we cannot read the script nor can we help you while it's like this.

1 answer

✓ Accepted answer

Hey there!

I would recommend not going through the player's PlayerGui, and instead using more of a local sort of script. I'm blanking on what this term is called, sorry!

But anyways, I am assuming that the button is in a separate gui, just inside of a ScreenGui. I would write the script like this:

local openButton = script.Parent
local guiToOpen = script.Parent.Parent.Parent.Parent:WaitForChild("TeamGUI")
script.Parent.MouseButton1Click:Connect(function()
	openButton.Visible = false
	local frames = guiToOpen:GetChildren()
	for i = 1, #frames do
		frames[i].Visible = true
		wait()
	end
end)

Go ahead and change the guiToOpen variable to the correct amount of ".Parents"

I hope this helps, and please let me know if you have any further questions!

1 comment

0

i dont know how many .parent to do.

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