From e66ae173bc800a8f99cca1e54c2e343946b93e1c Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Tue, 30 Jun 2026 13:52:13 +0200 Subject: [PATCH] Update keybinds.lua --- modules/keybinds/client/keybinds.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/keybinds/client/keybinds.lua b/modules/keybinds/client/keybinds.lua index ae85825..6990c19 100644 --- a/modules/keybinds/client/keybinds.lua +++ b/modules/keybinds/client/keybinds.lua @@ -1,14 +1,21 @@ local keybinds = {} -function ps.addKeybind(key, commmand) +function ps.addKeybind(key, command, message) if not keybinds[key] then - keybinds[key] = {command = commmand, disabled = false} + keybinds[key] = { + command = command, + disabled = false + } + RegisterCommand(key, function() if not keybinds[key].disabled then ExecuteCommand(keybinds[key].command) end end, false) - RegisterKeyMapping(key, 'Keybind for ' .. key, 'keyboard', key) + + message = message == nil and ('Keyboard for %s'):format(key) or message + + RegisterKeyMapping(key, message, 'keyboard', key) else if keybinds[key].disabled then keybinds[key].disabled = false @@ -27,4 +34,4 @@ function ps.removeKeybind(key) end exports('addKeybind', ps.addKeybind) -exports('removeKeybind', ps.removeKeybind) \ No newline at end of file +exports('removeKeybind', ps.removeKeybind)