i’m talking about input buffering in gaming, the definition for it:
Input Buffering is a core mechanic seen in most fighting games, which lets the player send the input for a move before the last execution is finished . This aids player into executing combos more easily, and is influenced by input delay.
how can i achieve something like this in… roadblocks?
Here is a script that queues inputs, It is very basic so it only adds inputs to a queue and nothing else.
-- Inside a LocalScript
local inputQueue = {}
local UIS = game:GetService("UserInputService")
function contains(t: {any}, v: any)
for _, c in t do
if c == v then
return true
end
end
return false
end
UIS.InputBegan:Connect(function(input)
if not contains(inputQueue, input.KeyCode) then
table.insert(inputQueue, input.KeyCode)
end
end)
-- Handle the logic for reading the queue