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

How to make a keybinding Gui?

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

✓ Accepted answer

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.

p = game.Players.LocalPlayer
mouse = p:GetMouse()

mouse.KeyDown:connect(function(key)
		if key == "h" then
	if script.Parent.Visible == true then
		script.Parent.Visible = false
	else
		script.Parent.Visible = true
	end
		end
end)

3 comments

0

Thank you have saved me alot of time

0

Np

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.

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

mouse = game.Players.LocalPlayer:GetMouse()

local function onKeyDown( key )
    if key:lower() == "h" then
	-- Your Code
end
mouse.KeyDown:connect(onKeyDown)

1 comment

0

Yours is also good for tools as well if i could i would accept both

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