I am currently making a sprint script. but for some reason, when speed = 0. The animation doesn’t stop playing. Me disabling the animate script inside of the character has nothing to do with it.
hum.Running:Connect(function(speed)
if speed == 0 and run then
print(speed)
if Track1 then
Track1:Stop()
end
game.Players.LocalPlayer.Character.Animate.Disabled = false
hum.WalkSpeed = 16
local properties = {FieldOfView = DefaultFOV}
local Info = TweenInfo.new(0.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera,Info,properties)
T:Play()
elseif run then
print(speed)
local now = tick()
local difference = (now - lastTime)
if difference <= 0.5 then
game.Players.LocalPlayer.Character.Animate.Disabled = true
run = true
Track1 = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Animation)
Track1:Play()
hum.WalkSpeed = 20
local properties = {FieldOfView = DefaultFOV + 15}
local Info = TweenInfo.new(0.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera,Info,properties)
T:Play()
end
lastTime = tick()
end
end)