The Old Animation problem

I’m trying to change the default animations.
The first time when I do it it’s fine, but if I try to do it one more time it won’t replicate across the server. Look:

On client side it works perfectly

Btw the running with katana animation does replicate across the server.

Here is the script that changes the animations:

local equippedF = game.ReplicatedStorage.katanaEvents.katanaEquippedPlr
local unequippedF = game.ReplicatedStorage.katanaEvents.katanaUnequippedPlr
local blocking = false

equippedF.OnServerEvent:Connect(function(plr)
	if not plr.Character:FindFirstChild("CurrentMove") then
		local Label = Instance.new("Folder")
		Label.Name = "CurrentMove"
		Label.Parent = plr.Character
	end
		
	local SS   = game:GetService("ServerStorage")
	local anims = SS.KatanaDiversity:FindFirstChild("KatanaAnim")
	
	local name       = plr.Name
	local char  	 = game.Workspace:FindFirstChild(name)
	local Animations = char:FindFirstChild("Animate")
	
	
	
	local unseathe = Instance.new("Animation")
	unseathe.AnimationId = "rbxassetid://5248617291"
	local playunseathe = char:FindFirstChild("Humanoid"):LoadAnimation(unseathe)
	playunseathe:Play()
	
	
	Animations:Destroy()
	local newanim = anims:Clone()
	newanim.Parent = char
	newanim.Name = "Animate"
end)

unequippedF.OnServerEvent:Connect(function(plr)
	wait(0.1)
	local SS   = game:GetService("ServerStorage")
	local oranim = SS.KatanaDiversity:FindFirstChild("Animate")
	
	local name       = plr.Name
	local char  	 = game.Workspace:FindFirstChild(name)
	local Animations = char.Animate
	
	Animations:Destroy()
	local newanim = oranim:Clone()
	newanim.Parent = char
	newanim.Name = "Animate"
end)

The animations scripts are basically the default animation script but only changed the animation ids.

Please help,
Tem

1 Like

Well to replicate animation change you would need to activate it across the server using a script instead of a local script if you’re using a script. Local scripts tend to give problems in the server.

look how it is organized
https://gyazo.com/0b3e7efff99fc6400cb5b3702f8abc9f

only the animations scripts are local
(Animate, KatanaAnim)

Well in that case why don’t you trying putting those scripts in the player’s starter pack or startercharacterscripts.

I’ve tried the two suggestions and none fix the problem :frowning:

Try putting the scripts and animations in StarterGui

still not working
( 3 0 c h a r a c t e r s)

The suggestion is that you try play () and stop () at the same script. Can use wait (ani.length).

1 Like