So basically I created a script so when you click the tool it plays the animation. I created it in a place where I test my scripts. It worked fine there. When I transferred it to a different place, it wouldn't play the animation. I copied the entire tool over.
The tool is located in lighting, yes I know it's not the best place to put it so don't comment that. The animation and local script is located inside the tool. Also, I do know that I need to use a remote event if I want everyone to see the animation so don't comment that. I just need help figuring out why the animation is playing in one place and not another. I've tried disabling other scripts to see if that does anything but it doesn't.
Here's my code in the local script to run the animation:
script.Parent.Equipped:Connect(function(Mouse) Mouse.Button1Down:Connect(function() local animation = game.Workspace[game.Players.LocalPlayer.Name].Humanoid:LoadAnimation(script.Parent.Animation) animation:Play() end) end)