I have made a script that is supposed to open a GUI when clicked, but it won't work... Here is my script:
1 | local Menu = game.StarterGui.Menu |
2 | Menu.Enabled = false |
3 | local Button = game.StarterGui.Button |
4 | Button.Clicked:Connect( function (hit) |
5 | Menu.Visable = true |
Can somebody help me?
Yes. See, if the GUI is disabled, everything inside is disabled too. Make sure it's a LocalScript, then type:
1 | local Menu = game.StarterGui.Menu |
2 | Menu.Visible = false |
3 |
4 | script.Parent.MouseButton 1 Click:Connect( function () |
5 | Menu.Visible = true |
6 | end ) |
If you need to make it so that the same button makes it invisible too, then type in the LocalScript:
01 | local Menu = game.StarterGui.Menu |
02 | Menu.Visible = false |
03 |
04 | script.Parent.MouseButton 1 Click:Connect( function () |
05 | if Menu.Visible = true then |
06 | Menu.Visible = false |
07 | else |
08 | Menu.Visible = true |
09 | end ) |
10 | end ) |
here's a script, should do the job!
1 | local Menu = game.StarterGui.Menu |
2 | Menu.Visible = false |
3 | local Button = game.StarterGui.Button |
4 | Button.Clicked:Connect( function (hit) |
5 | Menu.Visible = true |
6 | end ) |