Your better off using the timeout approach anyway, it seems to be more reliable
-psuedocode-
NPC Code:
if timeout
if keydown key
if keydownlast = false
do keydown stuff
keydownlast = true
end if else
nothing end else
end if else
keydownlast = false
end else
timeout = .05
end timeout
why did I even bother making that pseudocode anyway?