Ad
Log in to vote
0

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

Asked by 7 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
7 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:

--IN A LOCAL SCRIPT

game.Players.LocalPlayer:GetMouse().KeyUp:connect(function(key)
    if key == "q" then --or whichever key
        --your code
    end
end)

Hope this helped you!

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

Answer this question