Animation playing on Server and Client, but not on other clients

I have a local script to animate my monster in my game, but the script plays the animation on the server and the monster’s client, but not on other players clients. What’s wrong with my code and how can I fix it?

Animate Script

-- local bot = script.Parent
local humanoid = bot:WaitForChild("Humanoid")
local botRoot = bot:WaitForChild("HumanoidRootPart")
local animations = humanoid:WaitForChild("Animations")
local animator = humanoid:WaitForChild("Animator")
local run = animator:LoadAnimation(animations.Run)
local idle = animator:LoadAnimation(animations.Idle)
run:Play()
run:Stop()

for i, anim in pairs(animator:GetPlayingAnimationTracks()) do
	anim:Stop()
end

idle:Play()

humanoid.Running:Connect(function(speed)
	if speed > 0.75 then
		idle:Stop()

		if not botRoot.Footsteps.Playing then
			botRoot.Footsteps:Play()
		end

		run:Play()
	else
		botRoot.Footsteps:Stop()
		run:Stop()
		if not idle.IsPlaying then
			idle:Play()
		end
	end
end)

u supposed to animate the monster on a normal script (serverside)

I feel like what’s going on here is that the game gives the player ownership of the monster, so if the player’s client plays an animation it will also player on the server. As for why on the other client it’s not playing at all I don’t know, if the LocalScript runs on other clients too they should still be able to see their own animations.

If you use a serverside script for player animations, the animation lags behind by a little because of latency, but using a local one allows the animation to run in real time.

Roblox uses local scripts for player animation, just check your character in roblox studio!

Solved the problem, I relocated the local animation script from serverScriptService to ReplicatedStorage and that seemed to fix the issue. Must be some problem with replication or something? Anyways, fixed now!

PS: I also set the network ownership to the player along with moving the script

Local scripts don’t run when placed inside the ‘ServerScriptService’ container.

Valid server script containers include; ‘Workspace’, ‘ServerScriptService’.
Valid local script containers include; ‘StarterGui’, ‘StarterPack’, 'StarterCharacterScripts, ‘StarterPlayerScripts’.

https://developer.roblox.com/en-us/api-reference/class/LocalScript
https://developer.roblox.com/en-us/api-reference/class/Script

No, the script is cloned and placed inside of their character in workspace. I think that maybe because it was a localscript that it wasn’t replicating properly when I’d clone it, as it only existed on the server at that time.

That or the NetworkOwner not being set to the player was the problem.

Yeah, local scripts can’t clone server scripts.