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

How to make it so that when you click a textbutton inside a GUI, then have another GUI appear?

Asked by
Vexxied 10
8 years ago

I am making a anti exploit service and I have 2 GUIs for it, one of them is the GUI where you report players (visible is set to false), that also sends the reports to a trello board. And the other is a GUI with a imagelabel (visible is set to true), and a TextButton inside it. I tried to make a script that makes it so that when someone clicks the invisible TextButton that is around the logo imagelabel, it makes the ButtonGui Dissappear and the Report GUI appear. The name of the textbutton is "create" btw. The script is placed inside the frame inside the ButtonGUI with the imagelabel, the textbutton, and the script. Also, the Report GUI is "ScreenGui" btw. Am I doing something wrong?

The script I have is:

script.Parent.Frame.create.MouseButton1Click:connect(function()
  game.StarterGui.ScreenGui.Frame.Visible = true
game.StarterGui.ButtonGui.Frame.Visible = false
end)

1 answer

Log in to vote
0
Answered by 8 years ago

Well depending on where the GUI is and what they're named, I'll set a template for you.

script.Parent.MouseButton1Down:connect(function(Click) -- Start the function with the name of Click.
    script.Parent.Visible = false -- This will turn off the button GUI, by going up 1 with .Parent
    script.Parent.Parent.ScreenGUI.Frame.Visible = true -- This will go up 2 times with .Parent, then get the frame with the name of frame.
end)

If this answered your question, click the 'Accept Answer' button below the vote buttons.

Ad

Answer this question