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

How to make a keybinding Gui?

Asked by 9 years ago

Look i am making this game all on my own because nobody will help so please give me this little bit of support.

How would i make a Keybinding Gui script? So like Press H for help

2 answers

Log in to vote
1
Answered by 9 years ago

Okay, assuming that it is a frame that you want to be opened, you would do this. Just make a Local Script inside the frame and paste this in it.

01p = game.Players.LocalPlayer
02mouse = p:GetMouse()
03 
04mouse.KeyDown:connect(function(key)
05        if key == "h" then
06    if script.Parent.Visible == true then
07        script.Parent.Visible = false
08    else
09        script.Parent.Visible = true
10    end
11        end
12end)
0
Thank you have saved me alot of time Codboy22 9 — 9y
0
Np attackonkyojin 135 — 9y
0
IF you need a script to run an animation on click or on a keydown just make another question and PM me on roblox. attackonkyojin 135 — 9y
Ad
Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

Well, to detect when a player pushes a button, you would use KeyDown as well as GetMouse to get the Player's mouse.. Example:

1mouse = game.Players.LocalPlayer:GetMouse()
2 
3local function onKeyDown( key )
4    if key:lower() == "h" then
5    -- Your Code
6end
7mouse.KeyDown:connect(onKeyDown)
0
Yours is also good for tools as well if i could i would accept both Codboy22 9 — 9y

Answer this question