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
01 | local animation = Instance.new( "Animation" ) |
02 | animation.AnimationId = "http://www.roblox.com/Slash-Test-item?id=271296707" |
03 | local player = script.Parent.Parent |
04 | --local animTrack = player.Humanoid:LoadAnimation(animation) |
05 | local tool = script.Parent |
06 |
07 | tool.Equipped:connect( function (Mouse) |
08 |
09 | Mouse.Button 1 Down:connect( function () |
10 |
11 | print ( "Slash" ) |
12 | local animTrack = player.Humanoid:LoadAnimation(animation).animTrack:Play() |
13 | --animTrack:Play() |
14 |
15 | end ) |
16 | end ) |
Thank you!
01 | local animation = Instance.new( "Animation" ) |
02 | animation.AnimationId = "http://www.roblox.com/asset/?id=271296707" --Changed this into an AssetID |
03 | local player = script.Parent.Parent |
04 | --local animTrack = player.Humanoid.Animator:LoadAnimation(animation) |
05 | local tool = script.Parent |
06 |
07 | tool.Equipped:connect( function (Mouse) |
08 |
09 | Mouse.Button 1 Down:connect( function () |
10 |
11 | print ( "Slash" ) |
12 | local animTrack = player.Humanoid.Animator:LoadAnimation(animation) -- I changed this to Animator. I did this before, and I found doing this easier. |
13 | animTrack:Play() |
14 | end ) |
15 | end ) |