If/then statement problem

Blitz3D Forums/Blitz3D Programming/If/then statement problem

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

For thisbullet = Each bullettype				;iterate through all of the bullets
	If CountCollisions(thisbullet\entityhandle) > 0	Then	;check if bullet collided with something
		enemyhit = EntityCollided(thisbullet\entityhandle, 3)	;note which enemy (entity type 3) bullet collided with (if any)

   	 	If enemyhit > 0 Then 
			KillBadGuy(enemyhit)
			PlaySound(explosion)
			PlaySound(torpedoimpact) 
			particleemitter5=CreateEmitter_explosion() 
			ShowEntity particleemitter5
			PositionEntity particleemitter5,0,0,0
			FreeEntity thisbullet\entityhandle	;delete the bullet mesh
    			Delete thisbullet	;delete the bullet
  		EndIf	
	Endif