Key binds based on RegisterKeyMapping native, allows to make more optimized scripts without loop
- Resmon 0.00ms
- You can add unlimited events to one Key
- Easy to use
- Support for all keyboard and mouse buttons
Usage
client_script "@keybinds/lib.lua"
AddBind(key, onPressFunction)
Example
-- Mouse press
AddBind("MOUSE_RIGHT", function()
print("Right mouse")
end)
-- Keyboard press
AddBind("H", function()
print("H pressed")
end)
-- Hold
AddBind("Z", function(InputActive)
while InputActive() do
Wait(0)
print("Z holding")
end
end)
-- Disable Z and H keys for 3 seconds
exports["keybinds"]:AddBindRestriction({"Z", "H"}, true)
Wait(3000)
exports["keybinds"]:AddBindRestriction({"Z", "H"}, false)