local plr = game.Players.LocalPlayer
local char = plr.Character
local hum:Humanoid = char:WaitForChild("Humanoid")
local track = hum.Animator:LoadAnimation(script.RunAnim)
local uis = game:GetService("UserInputService")
local isRunning = false
uis.InputBegan:Connect(function(input, isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.LeftControl then
if isRunning == false then
isRunning = true
hum.WalkSpeed = 24
elseif isRunning == true then
isRunning = false
hum.WalkSpeed = 16
end
end
end)
plr.PlayerGui.Mobile.RunButton.MouseButton1Click:Connect(function()
if isRunning == false then
isRunning = true
hum.WalkSpeed = 24
elseif isRunning == true then
isRunning = false
hum.WalkSpeed = 16
end
end)
hum.Running:Connect(function(speed)
if speed > 0 and isRunning == true then
track:Play()
else
track:Stop()
end
end)
hum.Jumping:Connect(function()
track:Stop()
end)
hum.Climbing:Connect(function()
track:Stop()
end)
#the running animation wont stop playing after i jump
4 messages · Page 1 of 1 (latest)
It’s because you are only updating the running state whenever there user input begins
Which is why it doesn’t stop playing until you press another key(because that counts as user input)