I could also check how often he attacks the player in the script, I don't think it plays on a loop. In another story I just counted the shots and then beat him to death. Also, the raider only has 20 shells, so if you manage to make him 20 times, you can beat him too xD