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

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

Asked by 1 year ago

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?

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. Partykidcrazy 15 — 1y
0
that does make sense. ill try both and see Cubispaghettis 2 — 1y

1 answer

Log in to vote
1
Answered by 1 year ago
Edited 1 year ago

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.

0
if its a screen gui, it should work fine with a local script, right? Partykidcrazy 15 — 1y
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 MoralArsonism 47 — 1y
0
Alright, thanks! Cubispaghettis 2 — 1y
0
The problem is that both buttons have the same parent, so what do i need to change Cubispaghettis 2 — 1y
Ad

Answer this question