Make a TextButton appear when you press another TextButton?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear.

When you press one TextButton, another TextButton appears.

  1. What is the issue? Include screenshots / videos if possible!

I cannot figure it out, and nobody I know can figure it out either.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I had a look on some help servers, and other posts but they dont explain my problem well enough, but I may have missed something.

The bit highlighted is the button I want to appear when you press one of the buttons which has a circle/whatever you consider that around them.

Make sure to have another visible and the other one not visible when starting

function switchButtons()
   button1.Visible = not button1.Visible
   button2.Visible = not button2.Visible
end

button1.MouseButton1Click:Connect(switchButtons)
button2.MouseButton1Click:Connect(switchButtons)

I don’t know why you made a whole entire new function just for a button click.

Edit: nvm i know why now loool

if button1.Visible then…?

charscharscharscharschars

my script didnt work???

I’m just asking if it would be more efficient to use that

nope, im pretty sure this is shorter way

u should use that when u want to do that with more than 2 buttons

You can use the Button.MouseButton1Click event and the TextButton.Visible property. Here is an example of how you can do this:

local button1 = script.Parent
local button2 = button1.Parent:FindFirstChild("Button2")

button1.MouseButton1Click:Connect(function()
    button2.Visible = true
end)

This code assumes that the two buttons are siblings in the hierarchy, with button1 being the TextButton that you want to press to make button2 appear. When button1 is clicked, the MouseButton1Click event is fired, and the Visible property of button2 is set to true , making it visible.

You can also use the TextButton.Text property to set the text displayed on the button, and the TextButton.Size property to set the size of the button. For example:

local button1 = script.Parent
button1.Text = "Click me"
button1.Size = UDim2.new(0, 100, 0, 50)

This code sets the text displayed on button1 to “Click me” and the size of button1 to 100 pixels wide and 50 pixels tall.

I was a bit confused about the part about the circle, but this is how I understood your question:

If you want to make the TextButton appear when you press any of the buttons with a circle around them, you can add the same event handler to each of those buttons. For example:

local buttons = script.Parent:GetChildren()
local button2 = script.Parent:FindFirstChild("Button2")

for _, button in pairs(buttons) do
    if button:IsA("TextButton") and button.Name ~= "Button2" then
        button.MouseButton1Click:Connect(function()
            button2.Visible = true
        end)
    end
end

This code gets all the children of the parent object, filters out any that are not TextButtons or are Button2, and adds the event handler to each of the remaining buttons. When any of these buttons is clicked, the MouseButton1Click event is fired, and the Visible property of button2 is set to true , making it visible.