Animation does not play

Here is my code. Assets is a folder with animations, particle effects, sounds and models.

	local anim2 = humanoid:LoadAnimation(assets.animation)
	anim2:Play()
local character = script.Parent
local humanoid = character.Humanoid
local humanoidRootPart = character.HumanoidRootPart
local head = character.Head
local player = game.Players:GetPlayerFromCharacter(character)
local rightArm = character["Right Arm"]

This script is parented to the character once it spawns. It is all in a ServerScript. Here is a ModuleScript that does that. “player” is a string.

	local actualPlayer = game.Players:FindFirstChild(player)
	local character = actualPlayer.Character
	local clone = script.server:Clone()
	local clientClone = script.client:Clone()
	clone.Parent = character
	clone.Disabled = false
	print(actualPlayer:GetChildren())
	clientClone.Parent = actualPlayer.Backpack
	clientClone.Disabled = false

Could you please clear up some confusion because you are all over the place with this post.

Which script is your animation code(Your first set of code) in?

What part does your third set code play? It clones scripts, I get that, but how does it affect your animations?

It clones the script that plays the animation. My first and second set of code are cloned by the other script.

To use LoadAnimation() you first need to reference the Animator that’s inside the humanoid, so in the anim2 variable, change it to
local anim2 = humanoid.Animator:LoadAnimation(assets.animation)

Yes, I didn’t want to write all that out because I am using a phone.

@DenisVesteria, I wouldn’t recommend cloning scripts unless you have a script that is creating something that requires one, and even then…
I would just make a main script that animates and controls everything.

Ok, i understand at the end, that’s a common issue.

Uhh and as @AlbertSeir said, try to make one main script instead of a lot

I am well aware of performance issues. Thanks.

Unfortunately this solution did not work.

	local anim2 = humanoid.Animator:LoadAnimation(assets.anim)
	anim2:Play()