Animation is playing twice when called once

I have an script call an animation once it receives a signal from the client, but the animation is running twice when the signal is being sent and received only once, and nothing that comes after the animation gets called twice.

	elseif what == "PlayIdleComboOver" then
		print("bla2")
		for i, v in pairs(character.Humanoid.Animator:GetPlayingAnimationTracks()) do
			v:Stop()
		end
		wait(1)
character.Humanoid:WaitForChild("Animator"):LoadAnimation(animationsmodule[itemsmodule[currentweapon].Attributes.Type][wieldstate].Idle):Play()
		print("test")

This is the output:

14:59:55.696 bla2 - Server - Combat:86
14:59:56.714 :arrow_forward: GreatswordIdle1H (x2) - Server - Combat:50
14:59:56.714 test - Server - Combat:95

Notice how both bla2 and test only get outputted once.

1 Like

There’s no reference to ‘GreatswordIdle1H’ in the code you posted, could you show me some more of the code?

1 Like

It’d just be whats in the module.
image
image

The module points towards whatever the player is using. The animations works, the problem is its called twice in this single line, where the entire function only runs once.

1 Like

Hmmmm… thats strange
I’m no expert with animations, so I don’t really know how to help. Sorry!

1 Like

From the code given all I can think of is that the inbuilt animator scripts are independently running the anim when loaded.
You could try separating the load and play and running a check along the lines of if not anim.playing then etc

1 Like