Ive Been trying to figure this out for days Please Help!
✓ ANSWER ACCEPTED
How Does A Text Button in Gui Is clicked And Another Gui Pops Up?
1 answer
✓ Accepted answer
Your title's grammar, amazing. I'm assuming you'd like to know how to make a GUI pop up when you click a text/image button. So, That's what I'll tell you. Sense we'll need the local player's mosue, we'll start off with this:
repeat wait() until game.Players.LocalPlayer
Why that? So the local player is there before anything else can happen. (Preventing errors) Next we get the mouse;
local mouse = game.Players.LocalPlayer:GetMouse()
Now, lets be neat, and tell it the directory of our frames and buttons.
local FirstFrame = script.Parent.Parent --Or wherever your first frame is, the text button is likely inside of it, so this is what you'd usally put
local PopUpFrame = script.Parent.Parent.Parent.PopUp --Once again, change this to wherever your frame is located.
local Button = script.Parent --The script will most likely be in the button
Next we add the OnClick function, and the popup.
function onClick()
if PopUpFrame.Visible == true then
PopUpFrame.Visible = false
elseif PopUpFrame.Visible == false then
PopUpFrame.Visible = true
end
end
Button.MouseButton1Click:connect(onClick)
and then your done. The full script would look something like this:
repeat wait() until game.Players.LocalPlayer
local mouse = game.Players.LocalPlayer:GetMouse()
local FirstFrame = script.Parent.Parent --Or wherever your first frame is, the text button is likely inside of it, so this is what you'd usally put
local PopUpFrame = script.Parent.Parent.Parent.PopUp --Once again, change this to wherever your frame is located.
local Button = script.Parent --The script will most likely be in the button
function onClick()
if PopUpFrame.Visible == true then
PopUpFrame.Visible = false
elseif PopUpFrame.Visible == false then
PopUpFrame.Visible = true
end
end
Button.MouseButton1Click:connect(onClick)
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
it doesnt work
That's because you didn't change the locations of the frames and text button.
oh o thanks
If it worked then hit the button that says that I'd answered your question.