Ok so, the first you must create Script in ServerScriptService, the second, put this script:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
for _, track in pairs(animator:GetPlayingAnimationTracks()) do
track:Stop()
end
local animationScript = char:WaitForChild("Animate")
-- If avatar type is R15
animationScript.run.RunAnim.AnimationId = "" -- rbxassetid://[animation_asset_id]
-- If avatar type is R6
animationScript.walk.WalkAnim.AnimationId = "" -- rbxassetid://[animation_asset_id]
end)
end)
and third, find or create animation asset and copy his ID.
upd:
And yes, I forgot to say that for each type of avatar (R6 or R15) you need to do separate animations.