Basically, I have a problem with the animation. Here's the code:
while part.parent.Humanoid.health >= 1 do pew:Play() part.parent.Humanoid.Health = part.parent.Humanoid.Health -5 wait(pew.Length) wait(.1) end
The animation plays, but what happens is the gun goes in a burst, and the code does too. So the health goes down 5 twice in this burst.
Everything else in the code works fine, it's just the animation and humanoid help. Here's a short video of what happens: https://gyazo.com/1d65b907a1023bcdefac8315d7535a78
Animations don't have length in their properties, so you need to do it manually. You can find the length in Animation Editor. Here are 3 steps to find animation length and put it into your script:
You can import Animation Editor Animations by clicking the 3 dots, then clicking Import, and clicking "From Roblox" or "From FBX Animation"
There you can see all of the stats of the animation.
The length is at the top of the plugin frame.
I will give you some edits for your script:
while part.parent.Humanoid.health >= 1 do pew:Play() part.parent.Humanoid.Health = part.parent.Humanoid.Health -5 wait(animLength) -- animation length wait(.1) end