Correct me if I'm wrong but I believe when you're using " or " at the if statement you should specify it as you did before, Example:
1 | if Part.Parent ~ = "SmallShip" or Part.Parent ~ = "Cannon" or Part.Parent ~ = "Barrel" then |
And It seems that you might want to use and instead of or since if your Part.Parent is "Cannon" and you don't want it to continue It'll still continue since It always checks if Part.Parent isn't "SmallShip" and the same thing to if your Part.Parent is "SmallShip" Since if Part.Parent is also not "Cannon" it'll continue.
So basically in the end It'll always continue.
So you would just need to change the first and second loop, would be like this:
1 | if Part.Parent ~ = "SmallShip" and Part.Parent ~ = "Cannon" and Part.Parent ~ = "Barrel" then |
2 | if Part.Name = = "CannonBall" or Part.Name = = "Explosion" then |
Hopefully that helps you with that issue. :)