Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a gui correspond with a keyboard key?

Asked by 10 years ago

How do I make a gui button for a key on a keyboard? Ex: A gui that is also a shift key

1 answer

Log in to vote
0
Answered by
SanityMan 239 Moderation Voter
10 years ago

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 
3game.Players.LocalPlayer:GetMouse().KeyUp:connect(function(key)
4    if key == "q" then --or whichever key
5        --your code
6    end
7end)

Hope this helped you!

0
Thanks, this helped alot. platinumninja7 0 — 10y
0
No Problem! SanityMan 239 — 10y
Ad

Answer this question