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:

1local Menu = game.StarterGui.Menu
2Menu.Enabled = false
3local Button = game.StarterGui.Button
4Button.Clicked:Connect(function(hit)
5Menu.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:

1local Menu = game.StarterGui.Menu
2Menu.Visible = false
3 
4script.Parent.MouseButton1Click:Connect(function()
5       Menu.Visible = true
6end)

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

01local Menu = game.StarterGui.Menu
02Menu.Visible = false
03 
04script.Parent.MouseButton1Click:Connect(function()
05       if Menu.Visible = true then
06              Menu.Visible = false
07       else
08              Menu.Visible = true
09       end)
10end)
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!

1local Menu = game.StarterGui.Menu
2Menu.Visible = false
3local Button = game.StarterGui.Button
4Button.Clicked:Connect(function(hit)
5    Menu.Visible= true
6end)

Answer this question