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

I need help with a script that opens a gui when you click a button in a gui, help? [closed]

Asked by 6 years ago

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?

0
wheres ur script User#23365 30 — 6y

Closed as Not Constructive by User#21908 and User#23365

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
-1
Answered by 6 years ago
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.

0
:connect() is deprecated, use :Connect() User#23365 30 — 6y
Ad
Log in to vote
1
Answered by
SCP774 191
6 years ago

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. :)