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

(ANSWERED) How come my Text Button isn't opening the Menu GUI?

Asked by
Slatryte 104
5 years ago
Edited 5 years ago

Introduction

I have made a script that is supposed to open a GUI when clicked, but it won't work... Here is my script:

local Menu = game.StarterGui.Menu
Menu.Enabled = false
local Button = game.StarterGui.Button
Button.Clicked:Connect(function(hit)
Menu.Visable = true

Conclusion

Can somebody help me?

2 answers

Log in to vote
0
Answered by 5 years ago

Yes. See, if the GUI is disabled, everything inside is disabled too. Make sure it's a LocalScript, then type:

local Menu = game.StarterGui.Menu
Menu.Visible = false

script.Parent.MouseButton1Click:Connect(function()
       Menu.Visible = true
end)

If you need to make it so that the same button makes it invisible too, then type in the LocalScript:

local Menu = game.StarterGui.Menu
Menu.Visible = false

script.Parent.MouseButton1Click:Connect(function()
       if Menu.Visible = true then
              Menu.Visible = false
       else
              Menu.Visible = true
       end)
end)
Ad
Log in to vote
0
Answered by
harstud 218 Moderation Voter
5 years ago
Edited 5 years ago

here's a script, should do the job!

local Menu = game.StarterGui.Menu
Menu.Visible = false
local Button = game.StarterGui.Button
Button.Clicked:Connect(function(hit)
    Menu.Visible= true
end)

Answer this question