My animation isn't playing even thought it has a higher priority then walking animation

I made a running animation for my player, I set the priority to Action and the animation still doesn’t play. Here’s my script:

Server Script

local replicatedStorage = game:GetService("ReplicatedStorage")

replicatedStorage.Animate.OnServerEvent:Connect(function(player, animationId)
	local animation = Instance.new("Animation")
	animation.AnimationId = "http://www.roblox.com/Asset?ID="..animationId

	local loadAnimation = game.Workspace[player.Name].Humanoid:LoadAnimation(animation)
	loadAnimation:Play()
	wait(10)
	loadAnimation:Stop()
	animation:Destroy()
end)

Local Script

local replicatedStorage = game:GetService("ReplicatedStorage")
replicatedStorage.Animate:FireServer(6238126600)

image

1 Like

If you’re trying to run your own character’s animation, you’ll have to call it via client side with a LocalScript.
Below is a demo, code is inefficient, but it works:
Local Script, place in StarterCharacterScript

local replicatedStorage = game:GetService("ReplicatedStorage")

local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID="..animationId

if not game.Players.LocalPlayer.Character then
    game.Players.LocalPlayer.CharacterAdded:Wait()
end
local loadAnimation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animation)
loadAnimation:Play()
wait(10)
loadAnimation:Stop()
animation:Destroy()

The only time you can run animations with a server script is when it’s done on NPCs or Bots.

1 Like

Oh, the animation was for R15 and I had my game set to R6. :weary:
Thanks for your help tho!