Why is the animation not replicated on the server? [Solved]

If its executing by a local script, make sure to add a remote event, which fires whenever a its is called!
Let me show you an example;
(LocalScript)

local hi = "Hello! "..game.Players.LocalPlayer.Name
game.ReplicatedStorage.EVENT:FireServer(hi)

(ServerScript)

-- Fires whenever EVENT is called
game.ReplicatedStorage.EVENT.OnServerEvent:Connect(function(player,hi) 
print(hi) -- Will print "Hello! "..{user} and will be seen for everyone
end)

…this is the game, reply back if you still need help!

I understand you, but the problem is that the animation works perfectly on the client, but it does not replicate well on the server, apart from the fact that when I die I get an error and the animations stop working.

I just started experiencing this exact issue a couple of minutes ago. Possibly related to a Roblox update? No changes were made on my end.

You need to be using Humanoid:LoadAnimation() instead of Animator:LoadAnimation().

yeah i also just got this error. believe updates broke it. please report it!

I’ve done so here.

I am using Animator: LoadAnimation because Humanoid: LoadAnimation is deprecated.

1 Like

You are correct in stating that you do not need remote events to allow the server to see the animations. Animations should automatically replicate to the server. I have also started experiencing this problem as of recently.

I never knew that! Apologies, is this script a LocalScript?

you probaly need. a server script for the animation when the tool is equipped like this

local animation = script.Parent.Animation
local tool = script.Parent

tool.Equipped:Connect(function()
    Animation:Play()
end

Just an example.

Yes, everything seems to work fine on the client, the problem is that the animations are not replicated correctly on the server, apart from that when I die I get an error.

u cant use local script to interact with the server unless u are using a remote event

Yeah, that’s why I am asking if it’s a LocalScript, because you can only call FireServer on a LocalScript.

that looks like a server script to me

It is a LocalScript, as he stated before:

i would say no. thats why i said it looks like a server script

In fact I tried to do it in a server script but it is worse, besides I get this error and I do not understand why:
image

This is the code:

local Tool = script.Parent
local Player = game:GetService("Players")
local Character = Tool.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://6350259222"
local AnimationTrack = Animator:LoadAnimation(Anim)
local Anim2 = Instance.new("Animation")
Anim2.AnimationId = "rbxassetid://6364334315"
local AnimationTrack2 = Animator:LoadAnimation(Anim2)
local db = false

--Animation
Tool.Equipped:Connect(function()
	AnimationTrack:Play()
	AnimationTrack.Priority = Enum.AnimationPriority.Idle
	Humanoid.UseJumpPower = true
	Humanoid.WalkSpeed = 0
	Humanoid.JumpPower = 0
end)
Tool.Activated:Connect(function()
	if db == false then
		db = true
		AnimationTrack2:Play()
		AnimationTrack2.Priority = Enum.AnimationPriority.Action
		Player.leaderstats.Strength.Value = Player.leaderstats.Strength.Value + 1
		wait(2)
		db = false
	end
end)
Tool.Unequipped:Connect(function()
	AnimationTrack:Stop()
	AnimationTrack2:Stop()
	Humanoid.UseJumpPower = true
	Humanoid.WalkSpeed = 16
	Humanoid.JumpPower = 50
end)

It is similar to the previous one but with a small change, the animation does not replicate well neither on the client nor on the server.

OMG I found an issue for you. Infinite yield possible means it is stuck on finding that specific instance that was stated in the script. Use FindFirstChild, because if it returns nil, it returns nil instead of erroring!

I tried to do that too but I get this error now:
image

That error message means the parent is the item not found. FindFirstChild cannot be called because there is nothing to search.