So Im having trouble with GUI hotkeys. I know how to script the actual hotkey, but I dont want it to be a single letter such as H, I want it to be Tab but I don't know how to do that, I also need it when you hold the tab the gui is open and when you release it goes away, my starting code is here
p = game.Players.LocalPlayer mouse = p:GetMouse()
mouse.KeyDown:connect(function(key) if key == "H" then if script.Parent.Visible == true then script.Parent.Visible = false else script.Parent.Visible = true end end end)

1 comment
KeyDown was deprecated a long while ago, wherever you got that from, stop using it as a source because they'll probably be using other deprecated code or utilising bad practises