01 | local Gun = script.Parent |
02 | local Animations = Gun:FindFirstChild( "Animations" ) |
03 |
04 |
05 | Gun.Equipped:Connect( function (part) |
06 | print ( "equip" ) |
07 | local humanoid = Gun.Parent:FindFirstChild( "Humanoid" ) |
08 | print (humanoid.Parent) |
09 | local Hold = humanoid:LoadAnimation(Animations.Hold) |
10 | Hold:Play() |
11 | end ) |
This gives the error 15:09:40.441 - Players.AthenaThorn.Backpack.Gun.GunScript:9: attempt to index nil with 'Hold'
But there's an animation called Hold in Animations folder.
local Hold = script.parent.Hold