Animation with tool not working on server

Hi, i’ve run into a problem with animations
Im trying to make animations for a sword. The character is supposed to swing the sword with both hands. upwards first, then downwards.
However, when i play it, the animations run smoothly on the client, but on the server side, the hand which holds the sword does not move. Code below

repeat wait() until script.Parent.Parent:FindFirstChild("Humanoid")
local userinputservice = game:GetService("UserInputService")
local character = script.Parent.Parent
local equipped = "6267736911"
local left = "6267848534"
local right = "6267786471"
local lunge = "6267935980"
local down = "6268064416"
local debounce = false
userinputservice.InputBegan:Connect(function(put,istyping)
	if not istyping then
		if script.Parent.Parent:FindFirstChild("Humanoid") then
			local input = put.KeyCode
			if input == Enum.KeyCode.Q or input == Enum.KeyCode.E or input == Enum.KeyCode.Z or input == Enum.KeyCode.C then
				script.Parent.RemoteEvent:FireServer(input)
				local animation = Instance.new("Animation")
				if input == Enum.KeyCode.Q then
					animation.AnimationId = "https://www.roblox.com/asset/?id="..lunge
					
				end
				local animationtrack = character.Humanoid:LoadAnimation(animation)
				animationtrack.Priority = Enum.AnimationPriority.Action
				animationtrack:Play()
				
			end
		end
	end
end)

(I only scripted the leftswing animation)
Videos below

CLIENT:

SERVER:


Please help, thanks!

Hey, in order for animations to replicate, they have to be made on the server or in Studio in advance - not on the go.

I’d set up an animation folder in ReplicatedStorage and use those.

Doesn’t work. I think the animations are replicating to the server, but the hand which holds the tool is not moving

I’ve read previous posts similar to this, the replies said to set the animation priority to action. I have already done it, but it still doesn’t work

Definitely not if the code above is still being used. I can clearly tell you’re creating the animation on the client-side resulting in the server not being able to stay in sync.

What I said is correct, and you have to make the animation instance with the id in advance where both the client and server can access it, such as ReplicatedStorage.

repeat wait() until script.Parent.Parent:FindFirstChild("Humanoid")
local userinputservice = game:GetService("UserInputService")
local animations = game.ReplicatedStorage.SwordAnimations
local character = script.Parent.Parent
local equipped = animations.Equipped
local left = animations.Leftswing
local right = animations.Rightswing
local lunge = animations.Lunge
local down = animations.Downswing

local debounce = false
userinputservice.InputBegan:Connect(function(letter,istyping)
	if not istyping then
		if script.Parent.Parent:FindFirstChild("Humanoid") then
			local input = letter.KeyCode
			if input == Enum.KeyCode.Q or input == Enum.KeyCode.E or input == Enum.KeyCode.Z or input == Enum.KeyCode.C then
				script.Parent.RemoteEvent:FireServer(input)

				
				if input == Enum.KeyCode.Q then
					local animationtrack = character.Humanoid:LoadAnimation(left)
					animationtrack.Priority = Enum.AnimationPriority.Action
					animationtrack:Play()
					
				end
				
				
			end
		end
	end
end)

Hi. The animations are replicating, but the hand is still not moving. Above is the code that im using right now

Solved it, the animation priority needs to be set in animation editor for it to work.