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)

5 comments
If it is what Photon said, how do I make it only R6. Here is a link to the error. https://gyazo.com/7a9e941026745942e55fa6ba39b81e79
The error means the AnimationId isn't trusted, or doesn't actually exist.
Exactly. You can only use Animations made by Roblox or yourself. You can't use other people's animations or it will give you that exact error.
So should I try making a new animation because the one in the script is mine.
Probably... Sorry that I couldn't help further dude.