tech/game

21/07/31 Roblox Studio Tutorial: How to Make a Pop-up Menu

tech-lover 2021. 7. 31. 22:12

https://youtu.be/i-VUfANaxEg

 

```

local openButton = script.Parent.Parent.OpenMenu

local frame = script.Parent

local button1 = script.Parent.Button1

local button2 = script.Parent.Button2

local button3 = script.Parent.Button3

 

frame.Visible = false

 

local notOpen = true

 

local function openMenu()

    if notOpen then

        notOpen = false

        frame.Visible = true

    else

        notOpen = true

        frame.Visible = false

    end

    -- frame.Visible = not frame.Visible

end

 

local function Button1()

    print("Button1 was clicked")

end

local function Button2()

    print("Button2 was clicked")

end

local function Button3()

    print("Button3 was clicked")

end

 

openButton.MouseButton1Click:Connect(openMenu)

button1.MouseButton1Click:Connect(Button1)

button2.MouseButton1Click:Connect(Button2)

button3.MouseButton1Click:Connect(Button3)

```