US Trends

how to open and close amongus hook roblox keybind

For a Roblox GUI or “hook” style open/close setup, the usual keybind approach is to use one key to toggle the interface on and off, not separate open and close keys. A common pattern is pressing the same key, like K, M, or E, to switch the GUI between visible and hidden states.

Simple keybind logic

A basic Roblox LocalScript looks like this:

lua

local UserInputService = game:GetService("UserInputService")
local gui = script.Parent
local opened = false

UserInputService.InputBegan:Connect(function(input, gameProcessed)
	if gameProcessed then return end
	if input.KeyCode == Enum.KeyCode.K then
		opened = not opened
		gui.Enabled = opened
	end
end)

This works because the script remembers whether the GUI is already open, then flips that state each time the key is pressed.

How to use it

  • Put the script in a LocalScript.
  • Change Enum.KeyCode.K to whatever key you want.
  • If you are toggling a Frame instead of a full ScreenGui, replace gui.Enabled with frame.Visible.

If you meant the Roblox Studio shortcut

If you meant opening and closing something in Studio itself, Roblox Studio has customizable shortcuts in the shortcut settings, where you can assign keys for tools and actions.

Important note

If this is for a game UI, keep the keybind simple and avoid conflicting with chat or movement keys. Many Roblox tutorials recommend checking gameProcessed so the toggle does not fire while the player is typing.

TL;DR: Use one key to toggle opened = not opened, then set ScreenGui.Enabled or Frame.Visible based on that state.