Keybind
Captures a key from the user, then calls you every time it is pressed.
The smallest keybind#
main:Keybind({
Text = "Toggle aimbot",
Callback = function()
aimbot = not aimbot
end,
})Click the control, press a key, and it is bound. Callback runs on every press
of that key from then on.
Live preview
My Script
v1.0
Search…
Main
Visuals
Settings
Panic key
Building it up#
Pick a starting key:
main:Keybind({
Text = "Toggle aimbot",
Default = Enum.KeyCode.E,
Callback = toggleAimbot,
})React to rebinding — Changed fires when the user picks a new key, which
is different from the key being pressed:
main:Keybind({
Text = "Toggle aimbot",
Default = Enum.KeyCode.E,
Callback = toggleAimbot,
Changed = function(key)
print("now bound to", key.Name)
end,
})Remember it:
main:Keybind({
Text = "Toggle aimbot",
Default = Enum.KeyCode.E,
Save = "aimbotKey",
Callback = toggleAimbot,
})Every option#
| Option | Type | Default | What it does |
|---|---|---|---|
Textreq | string | — | The label. |
Callback | function | — | Called each time the bound key is pressed. |
Default | EnumItem | — | The starting key, e.g. Enum.KeyCode.E. |
Changed | function(EnumItem) | — | Called when the user binds a different key. |
Description | string | — | A quieter second line. |
Icon | string | — | An icon shown before the label. |
HoverColor | Color3 | — | Overrides the hover tint. |
HoverFill | number | — | How strongly the hover state fills, 0 to 1. |
Save | string | — | Persist the bound key under this key. |
Methods#
| Method | Returns | What it does |
|---|---|---|
Get() | EnumItem | The currently bound key |
Set(keyCode) | — | Rebinds it |
local bind = main:Keybind({ Text = "Toggle", Default = Enum.KeyCode.E })
bind:Get() --> Enum.KeyCode.E
bind:Set(Enum.KeyCode.RightAlt) -- rebindsThis is not the window's own keybind
The key that hides and shows the whole window is set on
Ember.new with its Keybind
option, and defaults to RightShift. A Keybind control is for your script's
own actions.