How do I make a gui button for a key on a keyboard? Ex: A gui that is also a shift key
If you are using a local script, you can use GetMouse on the LocalPlayer, and have a Key event. I prefer the KeyUp event, which triggers after a key is released:
1 | --IN A LOCAL SCRIPT |
2 |
3 | game.Players.LocalPlayer:GetMouse().KeyUp:connect( function (key) |
4 | if key = = "q" then --or whichever key |
5 | --your code |
6 | end |
7 | end ) |
Hope this helped you!