I made a sprinting script (a localscript in the PlayerGui) that makes you sprint with an animation when you double tap and hold the W key. A wierd thing is happening: when you stop holding W, your walk animation returns to normal, but only on the client side. On the server side, the sprint animation keeps going permanently
local plr = game.Players.LocalPlayer
local char = plr.Character
local UserInputService = game:GetService("UserInputService")
local WTapped = false
local Time = 0.15
local running = false
UserInputService.InputBegan:Connect(function(Input, GameStuff)
if GameStuff then return end
if Input.KeyCode == Enum.KeyCode.W then
if not WTapped then
WTapped = true
wait(Time)
WTapped = false
else
while UserInputService:IsKeyDown(Enum.KeyCode.W) do
if running == false then
running = true
char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://3819460931"
char.Humanoid.WalkSpeed = 25
end
wait()
end
end
end
end)
UserInputService.InputEnded:Connect(function(Input, GameStuff)
if GameStuff then return end
if Input.KeyCode == Enum.KeyCode.W and running == true then
running = false
char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://180426354"
char.Humanoid.WalkSpeed = 16
end
end)

1 comment
glad u got it working