I have this gui here with an options button, I want to be able to click the options button and it opens another gui, can anyone help me with this?
✓ ANSWER ACCEPTED
I need help with a script that opens a gui when you click a button in a gui, help?
2 answers
✓ Accepted answer
local gui= script.Parent.Parent:FindFirstChild("gui")
local options= script.Parent
local open = false
options.MouseButton1Down:connect(function()
if open == false then
wait(0.5)
menu:TweenPosition(UDim2.new(0.25,0,0.2,0), "Out", "Quad", 1)
open = true
else
wait(0.5)
menu:TweenPosition(UDim2.new(-1,0,0.2,0), "Out", "Quad", 1)
open = false
end
end)
That should do it. Of course you will need to edit it to your preference.
2 comments
0
:connect() is deprecated, use :Connect()
Here's the general idea of how to open a GUI using a GUI button.
local BUTTON = {PATH TO THE GUI BUTTON HERE}
local GUIToOpen = {PATH TO THE DESIRED GUI TO OPEN HERE}
BUTTON.MouseButton1Down:Connect(function()
GUIToOpen.Visible = true
end)
You can modify the script in any way to make it toggleable, have more functions etc. You can make many things with this script, just explore more with it. :)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
wheres ur script