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

How do I make a text button open another text button?

So I have two text buttons under a frame. One is labeled ButtonA. The other is labeled ButtonB. Button A is visible but not button B. Anyone know how to make it so when you click button A, it makes button B visible? Would the script normal or local? Where would i put it?

2 comments

0

@tumtidy has pretty much the right awnser, but i'd like to get something straight: Local scripts are only for the player who has that script running while server scripts, or normal scripts run for everyone.  local scripts are mainly used in starter gui and starter player, im kind of new to scripting so i mightve gotten a bit wrong there.

0

that does make sense. ill try both and see

1 answer

Hi, I think I have found the solution. First, add a (normal) script into ButtonA and then copy and paste this code. Make sure ButtonB is not visible before running your code.


local ButtonA = script.Parent
local ButtonB = script.Parent.Parent.Parent.Frame.ButtonB


script.Parent.MouseButton1Click:Connect(function()
	if ButtonA.Visible == true then
		ButtonA.Visible = false
		ButtonB.Visible = true
	else
		ButtonA.Visible = true
	end
end)

Let me know if this helps. Also, you can change the variables if you have named your frame or buttons differently.

4 comments

0

if its a screen gui, it should work fine with a local script, right?

0

from what I know either a local script or a server script could work as each instance of a gui is under the player's gui and not seen by the server

0

Alright, thanks!

0

The problem is that both buttons have the same parent, so what do i need to change

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