Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

I'ma delete it soon, its already answered!

2 comments

0

Try using the MouseButton1Up event.

0

Okay..

1 answer

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.

1 comment

0

The Button is in the gui.

This discussion is preserved as it was. New answers, comments, and votes are closed.