Animation Replication issues with client AND server

Hi. I am currently working on a game which has a sprinting mechanic. On the client, the animation works fine. However, it does not replicate onto the server.

local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char.Humanoid

local sprintAnim = hum.Animator:LoadAnimation(script:WaitForChild("Run")) 

local TS = game:GetService("TweenService")
local UIS = game:GetService("UserInputService")

local SPRINT_STATE = false

UIS.InputBegan:Connect(function(k,p)
    if p then return end
        
    if k.KeyCode == Enum.KeyCode.W then
        local currentTime = tick()
        if currentTime - LASTPRESS <= EXIT_THRESHOLD then
            print("Sprint")
            SPRINT_STATE = true
            TS:Create(cam,TweenInfo.new(0.4),{ FieldOfView =  85}):Play()
            
            sprintAnim:Play()
            hum.WalkSpeed = 26
        else
            LASTPRESS = currentTime
        end
    end 
end)

UIS.InputEnded:Connect(function(k,p)
    if p then return end
    if k.KeyCode == Enum.KeyCode.W then
        SPRINT_STATE = false
        TS:Create(cam,TweenInfo.new(0.4),{ FieldOfView =  70}):Play()
        
        sprintAnim:Stop()
        hum.WalkSpeed = 12

    end

end)

Location of animations and script
image
I have been stuck on this issue for quite a while, and have not found any solutions despite seeking help in other dev posts and discord channels.

Did you publish the animation? I had the same problem, If you didn’t publish the animation then just make sure that you publish the animation

it is a group project and all animations have been published under the group


and for some weird reason im having the same issue when loading and playing the animation on the server!! It only shows on the tool owners client:

repeat wait() until script.Parent.Parent.Parent.Character ~= nil
local hum = script.Parent.Parent.Parent.Character.Humanoid
--//Loading the anims
local idleAnim = hum.Animator:LoadAnimation(script.idle)

script.Parent.Equipped:Connect(function()
    idleAnim:Play()
end)

Turns out the solution was the animation priority! All animations were set to action priority. I fixed this by changing the priority of the custom walking and idle anims