Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Animation and running aren't working and I don't know how to fix it?

Asked by 3 years ago

Not sure what I did wrong but it isn't working and I need help.

local player = game.Players.LocalPlayer local Character = player.Character or script.Parent local humanoid = player.Character.Humanoid local Humanoid = Character.Humanoid local UIS = game:GetService("UserInputService")

local AnimationId = 'rbxassetid://6267230901'

UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.LeftShift then if player.Character ~= nil then

        while player.Character.Humanoid.WalkSpeed >= 50 do 
            wait()

            local Animation = Instance.new("Animation")
            Animation.AnimationId = AnimationId
            local LoadAnimation = Humanoid:LoadAnimation(Animation)
            LoadAnimation:Play()

        end
    end
end

end)

UIS.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode.LeftShift then if player.Character ~= nil then player.Character.Humanoid.WalkSpeed = 16

        while player.Character.Humanoid.WalkSpeed <= 16 do 
            wait()

            local Animation = Instance.new("Animation")
            Animation.AnimationId = AnimationId
            local LoadAnimation = Humanoid:LoadAnimation(Animation)
            LoadAnimation:Stop()

        end
    end
end

end)

0
did you use moon animating or original animator bc in the normal one u have to enable movement to movement animations IEntity_303I 80 — 3y

Answer this question