A simple animation script for my sword isn't working. This is a localscript.
Script:
tool = script.Parent player = script.Parent.Parent.Parent Humanoid = player.Character.Humanoid script.Parent.Activated:connect(function(hit) local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=217206026" local animTrack = Humanoid:LoadAnimation(animation) animTrack:Play() end)
Ok, I think I fixed it.
tool = script.Parent player = game.Players.LocalPlayer.Character Humanoid = player.Humanoid tool.MouseButton1Down:connect(function() if tool.Equipped = true then local animation = Instance.new("Animation") animation.Parent = player animation.AnimationId = "http://www.roblox.com/Asset?ID=217206026" --Make sure this is one of your own animations, you can't play other people's because roblox doesn't allow it. local animTrack = Humanoid:LoadAnimation(animation) animTrack:Play() end)