I'm now having troubles as to why this won't work in a public server. This script only works in studio and I don't really know why.
wait(.5) id = "http://www.roblox.com/asset/?id=549955265" Example = script.Parent.Parent Animation = script:WaitForChild("Animation") Animation.AnimationId = id local animationTrack = Example.Humanoid:LoadAnimation(Animation) animationTrack:Play()
Some of you guys might recognize this script from the last question I asked, and I did solve that problem.. however I never realized it didn't work on a public server up until now. I have FilteringEnabled on in case that makes a difference with this script. I'm using an R15 rig, but I know that's not the reason why it's not working because an R6 rig doesn't work either with this script. Every other question related to this topic all points to using FindFirstChild or WaitForChild and I'm using WaitForChild so I don't really know what to do.
Ensure that this is in a localscript, as that is the only way animations can be used.
I also recommend taking a look at this blog post:
https://scriptinghelpers.org/blog/it-works-in-studio-but-not-online
I managed to figure out why this wasn't working! I didn't fully understand the differences between a ServerScript and a LocalScript, and all I knew was that one ran on the client's side, and one ran on the server side.
Anyway, I didn't know LocalScripts couldn't run in Workspace, so literally all I had to do was move it to StarterPack and reroute a few variables. Thank you to everyone who tried to help me!