Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

1 answer

✓ Accepted answer

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!

2 comments

0

Thanks, this helped alot.

0

No Problem!

This discussion is preserved as it was. New answers, comments, and votes are closed.