Single/multi-key binder for Roblox. Ties actions to one key or multiple keys. Easy input tool for game controls. Saves events in table. Simple, flexible.
Use?
You can bind Keybinds using the name of the key or Enum:
local KeyStrok = require(script:WaitForChild("KeyStrok"))
local EventA = KeyStrok({Enum.KeyCode.W},function()
print("1")
end)
EventA:Disconnect()
local EventA = KeyStrok({"W"},function()
print("1")
end)
You can bind similar structure key combination just like:
local KeyStrok = require(script:WaitForChild("KeyStrok"))
local EventC = KeyStrok({"W"},function()
print("1")
end)
local EventB = KeyStrok({"W","D"},function()
print("2")
end)
local EventC = KeyStrok({"W","D","E"},function()
print("3")
end)
KeyStrok(KeyList,Callback,isHeld)
--[[
put true or anything
if you want it to be detect for holds
]]
Example Usage:
local KeyStrok = require(script:WaitForChild("KeyStrok"))
local A = KeyStrok({"W"},function(IsHeld)
if IsHeld then
print("held")
else
print("not held")
end
end,true)
KeyStrok({"W","D"},function()
warn("combo!")
end)
local A2 = KeyStrok({"W","D"},function(IsHeld)
print("combo held!",IsHeld)
end,true)
Behavior:
If your detecting for W or W+D, on holds, it will return nil on the event it’s released or another Key has been added to the list, so it!
Hi,
For the silly question, is this reading when the player does the combo?
Also is there anyway of adding a feature where it could limit how fast a player could do a combo… do slow down the input of players that use programmable keys that react faster then what a human could do? Thanks
local CoolDown = 5
local ComboEvent do
local LastUsage
ComboEvent = KeyStrok(Combo,function()
if LastUsage and (LastUsage - os.clock() ) <= CoolDown then return end
LastUsage = os.clock()
-- Combo Function Below
end)
-- How to clean:
ComboEvent:Disconnect()
ComboEvent = nil
local RBXScriptSignal = KeyStrok(KeyList,Callback,nil or "isHeld" or "Both")
RBXScriptSignal:Disconnect()
--[[
the change is now "Both" it'd require another param
]]
Example Usage:
local KeyStrok = require(script:WaitForChild("KeyStrok"))
-- New:
local A = KeyStrok({"Shift","W"},function(IsClick,IsHeld)
if isClick then
Mine()
else
if IsHeld then
Task = task.spawn(function()
while task.wait(0.5) do
Mine()
end
end)
else
task.cancel(Task)
end
end
end,"Both")
-- Old:
KeyStrok({"W","D"},function()
warn("combo!")
end)
local A2 = KeyStrok({"W","D"},function(IsHeld)
print("combo held!",IsHeld)
end,true)
The point is on independent held or independent click, it’d let you know how long it was held for even if it’s a click, now lets say you want to clearly determine which one it is, if it’s a click or hold and for how long if held, then that’s what both is for.
Btw everything it had from old behavior was intentional, this is just extension to another use I needed and it didn’t have, because it was designed for fighting game but now it’s designed both fighting or general use! Cya
local Event = KeyStrok({"W"},function(isClick,isHeld)
if isClick then
print("click")
else
if isHeld then
print("down")
else
print("up")
end
end
end,{
Mode = "Both";
Local = true;
})
Event:Disconnect()
isHeld Mode:
local Event = KeyStrok({"W"},function(isHeld)
if isHeld then
print("down")
else
print("up")
end
end,{
Mode = "isHeld";
Local = true;
})
isClick Mode:
local Event = KeyStrok({"W"},function()
print("Click")
end,{
Mode = "isClick";
Local = true;
})
Supports Combos:
local Event = KeyStrok({"Shift","W","D"},function()
print("Click")
end,{
Mode = "isClick";
Local = true;
})
local being true or nil is the big part
it being local means it’s indepdant for movement of W,A,S,D or shift to run
but local off is like specific combo for fighting games or etc