hi all,
was just wondering if - similar to disabling all of a player’s controls - there’s an easy, cut and dry method of ignoring inputs from a specific key in UIS, thus making any subsequent calls (input.KeyCode == Enum.KeyCode.W) always return false (until reenabled)
I’m fairly certain there’s not, but I’m more than happy to be wrong; it would make my code a lot neater. thanks for the help!
local debounce = false
local function onInputBegan(key, processed)
if processed then return end
if key.KeyCode == Enum.KeyCode.W and (not debounce) then
debounce = true
task.wait(1)
debounce = false
end
end
userInputService.InputBegan:Connect(onInputBegan)