local LocalCharacter = script.Parent local Animate = LocalCharacter:FindFirstChild("Animate") do LocalCharacter.Animate.Idle.Animation1.AnimationId = "http://www.roblox.com/asset/?id=7391593289" LocalCharacter.Animate.Idle.Animation2.AnimationId = "http://www.roblox.com/asset/?id=7391593289" end
There's no context but there's no veriable that's called Idle. I also don't suggest putting the numbers in the script. For the knife I made I made four classesname.Animation's 1st was hit, 2nd was Idle, 3rd was left slash, and 4rth was right slash. So you're gonna wanna put the animations in the tool not in the handle.
local plr = game:GetService("Players").LocalPlayer local anims = {script.Parent.Animation1, script.Parent.Animation2} local loadedAnims = {} local tool = script.Parent local animator tool.Equipped:Connect(function(mouse) animator = plr.Character:WaitForChild("Humanoid"):WaitForChild("Animator") if not loadedAnims[1] then loadedAnims[1] = animator:LoadAnimation(anims[1]) end loadedAnims[1]:Play() end) tool.Unequipped:Connect(function() loadedAnims[1]:Stop() end
Put the animation priority to action so it can be used on a tool. Haven't tested it just the Idle yet but I hope this works for you!