local lastTime = tick()
local Player = game.Players.LocalPlayer
local Character = Player.Character
Input.InputBegan:connect(function(KeyInput)
if KeyInput.KeyCode == Enum.KeyCode.W then
local now = tick()
local difference = (now - lastTime)
if difference <= 1 then
Character.Humanoid.WalkSpeed = 30
else
Character.Humanoid.WalkSpeed = 16
end
end
end)
COMMUNITY QUESTION
I am trying to make a double tap w to sprint and there is a problem with the input?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
How do I solve it?
maybe reset the lastTime value to tick() before the end of "if KeyInput.KeyCode == Enum.KeyCode.W then" statement