Here's the script that i made for the running animation.
local UIS = game:GetService("UserInputService") local Players = game:GetService("Players") local player = Players.LocalPlayer local runAnim = Instance.new("Animation") runAnim.AnimationId = "rbxassetid://5827492961" local character = player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local humAnimator = humanoid:WaitForChild("Animator") local runAnimConfirm = humAnimator:LoadAnimation(runAnim) local isKeyPressed = false UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.LeftShift then isKeyPressed = true if isKeyPressed == true then humanoid.WalkSpeed = 32 runAnimConfirm:Play() end end end) UIS.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode.LeftShift then isKeyPressed = false if isKeyPressed == false then humanoid.WalkSpeed = 16 runAnimConfirm:Stop() end end end)
You can stop the player's current running animations then run your animations
Example here
for i,AnimationPlaying in pairs(Player.Character.Humanoid:GetPlayingAnimationTracks()) do AnimationPlaying:Stop() end --Load your animation and play it here
Roblox has their own tutorial on this.
Use this link: https://developer.roblox.com/en-us/articles/using-animations-in-games