This script is only working in studio. I am trying to make a gui button play an animation
Player = game.Players.LocalPlayer local Animation = Instance.new("Animation") Animation.AnimationId = "http://www.roblox.com/asset?id=501371142" function PlayAnimation() local animTrack = Player.Character.Humanoid:LoadAnimation(Animation) animTrack:Play() end script.Parent.MouseButton1Down:connect(PlayAnimation)
What type of animation is it? If it is R15 or R6 go to your game settings and only allow the type your doing. I think this will work becuase I had that same problem.
For example all my animations are for R6 so it wont work fro R15 so I have to go to game setting and change it so it only allows R6. And people with R15 mode will become R6.
It could be what PhotonLightning suggested, however if you play on a public server you can press CTRL + F9 in order to check any errors that have occured. Remember this, it can help you out a lot in the future.
Sometimes Studio just doesn't seem to want to show you all of the errors.