I want the animation to play when the player clicks, but it doesn't work in a game. It works in Studio and a Test Server.
script.Parent.Activated:connect(function()
if debounce then
local animationswing = Instance.new("Animation")
if game.Players.LocalPlayer.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
animationswing.AnimationId = "rbxassetid://886800502" --put animation id here
else
animationswing.AnimationId = "rbxassetid://886799196"
end
local animiTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animationswing)
if mouse.Target:FindFirstChild('Breakable') then
if (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - mouse.Target.Position).magnitude <= 16 then
if mouse.Target.Parent ~= workspace.Resources then
local mousetarget = mouse.Target
debounce = false
animiTrack:Play()
animiTrack:AdjustSpeed(stats["Speed"])
animiTrack.KeyframeReached:connect(function(kf)
if kf == "End" then
script.Parent.Server:FireServer(mousetarget, stats)
debounce = true
end
end)
end
end
end
end
end)
This is in a local script.
Output:
Animation "http://www.roblox.com//asset?id=886799196&serverplaceid=871165592" failed to load in "Animation.AnimationId": Animation failed to load

4 comments
Try asking this in the forums, I do not think there is anything wrong with your code (just briefly scanning through it) just might be something you have to troubleshoot. Go to the fourm section at the side of your roblox page and they should be able to help you. -Tritous
Can you post the error you got? If there wasn't one in game, then press CTRL + F9 to see the output.
Why CTRL + F9? Did nothing different to F9...
And if you read the post, you should've known......