So I was making an animation for one of my tools then I got an error that said Players.NavenTheNoob.Backpack.Apple.LocalScript:9: attempt to index nil with ‘Stop’
I have no idea on how to fix this an I really need help!
This is the code:
script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
animation:Play()
end)
end)
script.Parent.Unequipped:Connect(function()
animation:Stop()
end)