I'm trying to make a sword with its one custom animation when slashing, so far I have made the animation work without the sword instead pressing r plays the animation BUT I can't figure out how to fix this issue, so far no error pop ups are confirmed but the animation doesn't play. I need someone to explain to me what happened, not just short sentence answers.
Here's the script
local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Slash-Test-item?id=271296707" local player = script.Parent.Parent --local animTrack = player.Humanoid:LoadAnimation(animation) local tool = script.Parent tool.Equipped:connect(function(Mouse) Mouse.Button1Down:connect(function() print("Slash") local animTrack = player.Humanoid:LoadAnimation(animation).animTrack:Play() --animTrack:Play() end) end)
Thank you!
local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/asset/?id=271296707" --Changed this into an AssetID local player = script.Parent.Parent --local animTrack = player.Humanoid.Animator:LoadAnimation(animation) local tool = script.Parent tool.Equipped:connect(function(Mouse) Mouse.Button1Down:connect(function() print("Slash") local animTrack = player.Humanoid.Animator:LoadAnimation(animation) -- I changed this to Animator. I did this before, and I found doing this easier. animTrack:Play() end) end)