How do I change the visibility of a GUI with a keyboard input?
Asked by
4 years ago Edited 4 years ago
I've wrote a previous script before this one and both haven't worked for me. The script and input runs through and does the print("") function but the GUIs disappear.
I've tried everything I could and nothing seems to work so I'm asking for help here.
Here is the script:
03 | local Menu = game.StarterGui.ScreenGui.MenuGUI |
04 | local plr = game.Players.LocalPlayer |
08 | local Profile = Menu.Profile |
09 | local Friends = Menu.Friends |
10 | local Messages = Menu.Messages |
11 | local Location = Menu.Location |
12 | local Settings = Menu.Settings |
16 | local PFP = Menu.PlayerProfile |
20 | local UIS = game:GetService( 'UserInputService' ) |
25 | plr:GetMouse().KeyDown:Connect( function (K) |
27 | Profile.Visible = false |
28 | Friends.Visible = false |
30 | print ( "Menu GUI Deactivated" ) |
All of the variables are organized and I've made sure that they were correct but I've tried changing inputs and making it a thing that happens when joining but it doesn't work.
I was trying to link a link to the image of the folder but I can't figure out how to so bear with me please