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

[DONE!] I don't care if a mod deletes this now.. Anyways HOW DO I DO THIS?

Asked by 10 years ago

I'ma delete it soon, its already answered!

0
Try using the MouseButton1Up event. Kozero 120 — 10y
0
Okay.. Operation_Meme 890 — 10y

1 answer

Log in to vote
0
Answered by
Dummiez 360 Moderation Voter
10 years ago

If the button is not a member of either 2 of the GUIs (meaning that it is its own GUI), you can do something like this:

-- In a LocalScript
local button = script.Parent
local plr = game.Players.LocalPlayer
local gui1 = plr.PlayerGui["ScreenGui1"].Frame
local gui2 = plr.PlayerGui["ScreenGui2"].Frame

gui1.Visible = true
gui2.Visible = false
button.MouseButton1Click:connect(function(click)
    if gui1.Visible then 
        gui1.Visible = false
        gui2.Visible = true
    else
        gui2.Visible = false
        gui1.Visible = true
    end
end)

However, if the button was a parent of either GUI, you would need to add in the script from both buttons and using the same script would work, but changes would be needed.

0
The Button is in the gui. Operation_Meme 890 — 10y
Ad

Answer this question