Modules
AddKeybind
Client
lib.addKeybind(data)
  • data: table
    • name: string
    • description: string
    • defaultKey?: string
      • Default: None
    • currentKey: string
    • disabled?: boolean
    • disable?: function(self: table, toggle: boolean)
    • onPressed?: function(self: table)
    • onReleased?: function(self: table)
local keybind = lib.addKeybind({
    name = 'respects',
    description = 'press F to pay respects',
    defaultKey = 'F',
    onPressed = function(self)
        print(('pressed %s (%s)'):format(self.currentKey, self.name))
    end,
    onReleased = function(self)
        print(('released %s (%s)'):format(self.currentKey, self.name))
    end,
})

Keybinds can be enabled/disabled by using the disable method.

keybind:disable(true) -- disable
keybind:disable(false) -- enable