I have a GUI and I want to press a key, for example 'X' and the gui will open Press X again and it will close
This isn't a request site, but since this script is fairly easy... You need to use the KeyDown event as well as debounce.
Local Script
mouse = game.Players.LocalPlayer:GetMouse() open = false mouse.KeyDown:connect(function(key) if key:lower() == "x" then if open == false then script.Parent.Frame.Visible = true open = true else script.Parent.Frame.Visible = false open = false end end end)