local Player = game.Players.LocalPlayer
local Character = Player.Character
local Human = game.Players.LocalPlayer.Character
local Humanoid = Character.Humanoid
local TrcanjeAnim = Instance.new("Animation")
local Tapped = false
local Time = 0.75
TrcanjeAnim.AnimationId = 'rbxassetid://04779444465'
playTrcanjeAnim = Humanoid:LoadAnimation(TrcanjeAnim)
game:GetService("UserInputService").InputBegan:connect(function(input, gameprocesed)
if input.KeyCode == Enum.KeyCode.W then
if not Tapped then
Tapped = true
wait()
Tapped = false
for i = 1,16 do playTrcanjeAnim:Play()
Human:WaitForChild("Humanoid").WalkSpeed = 30
end
end
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input, gameprocesed)
if input.KeyCode == Enum.KeyCode.W then
for i = 1,16 do playTrcanjeAnim:Stop()
Human:WaitForChild("Humanoid").WalkSpeed = 16
end
end
end)
Also tell me if i messed up something in my script this is my Discord ne#6297

3 comments
Are you using this in an localscript? It is not NotReplicated across the client and server so that will be needed.
Because Minecraft
You could use firstTick = tick() when they first press W, and lastTick = tick() when they press W again, and check if the time between those 2 are minimum. by doing lastTick - firstTick. Tick() is in seconds.