How to replicate tool animations to all clients and the server?

I recently made a sword animation on a tool and I animated the handle using Motor6d, I originally made a local script for the animation but the sword handle animation doesn’t replicate, I then decide to make it a server script instead but the problem is that I can’t get the character from the server script…

External Media

This is the script:

local tool = script.Parent
local humanoid
local animationTrack
local UIS = game:GetService("UserInputService")
local toolEnable
local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local SwordStyles = require(game.ReplicatedStorage.Modules:WaitForChild("SwordStyles"))
local styleName = "Yoru"
local db = false


local m6d


tool.Equipped:Connect(function()
	local a:Weld = character:FindFirstChild("Right Arm"):WaitForChild("RightGrip")
	m6d = Instance.new("Motor6D")
	m6d.Parent = character:FindFirstChild("Right Arm")
	m6d.Name = "RightGrip"
	m6d.Part0 = a.Part0
	m6d.Part1 = a.Part1
	m6d.C0 = a.C0
	m6d.C1 = a.C1
	a:Destroy()
	
	local animationInstance = tool:FindFirstChildOfClass("Animation")
	

	if animationInstance then
		 humanoid = tool.Parent:FindFirstChildOfClass("Humanoid")
		if humanoid then
			animationTrack = humanoid:LoadAnimation(animationInstance)
			animationTrack:Play()
		end
		-- Add code to play sounds, spawn particle effects, etc.
		toolEnable = UIS.InputBegan:Connect(function(input,isTyping)
			
			if not isTyping and db == false then
			if input.UserInputType == Enum.UserInputType.MouseButton1 then
					SwordStyles:Attack(Player, styleName)
					end
			end
			
			



		end)
	end
end)


tool.Unequipped:Connect(function()
	toolEnable:Disconnect()
	m6d:Destroy()
	local animationInstance = tool:FindFirstChildOfClass("Animation")

	if animationTrack then
		animationTrack:Stop()
	end

end)

animations should play on the server if activated from a localscript. does the output give any errors, and is local animationInstance = tool:FindFirstChildOfClass("Animation") Specified properly?

One thing you can do is if you choose to use the serverscript, you can fire a remoteevent and when the client localscript recieves it, it can play the animation. But for tool animations, I had no problem replicating them on the server.

Everything is fine, like the animation of the character parts are fine but the sword itself stays static, this is what it looks like on other players screens, The sword handle stays upright it doesn’t move at all like the previous video

External Media

Remote event. Use Remote Events.