Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Animation plays fine on a LocalScript but not in ServerScript?

I'm trying to make an Animation play when a player equips a gun, and the animation shows, loops, and changes the priority on a LocalScript, but when I try doing it on a ServerScript so everyone can see it, it plays the animation but it acts like it ignores the Looped and Priority part. Any help? Thanks!

script.Parent.RemoteFunctions.EquippedFunction.OnServerInvoke = function(Plr)
	local TestingAnimation = Plr.Character.Humanoid:LoadAnimation(script.Parent.Animation.HoldingGunAnimation)
	TestingAnimation.Looped = true
	TestingAnimation.Priority = Enum.AnimationPriority.Action
	TestingAnimation:Play()
end

2 answers

✓ Accepted answer

Animations can actually been seen by anyone on a localscript, so that should solve you problem

1 comment

0

I actually didn't know that, XD

Changes to animation tracks do not replicate from the client. Since you set the animation to loop in the client it will only loop in the client. If you set it to loop in a server script and play it from there (possibly through remote events) it should be better.

This discussion is preserved as it was. New answers, comments, and votes are closed.