Attempt to index nil with 'humanoid' (Roblox Studio) – Stack Overflow

I'm trying to code a turret, shooting enemies when it gets in the range of the turret, and the code sometimes breaks giving me the error …
View full source