freeslot("MT_PARRYTHINGIE","MT_PARRYTHINGIE2","sfx_parry")

addHook("PlayerThink",function(player,mo)
 
 if player.isholdingm2 == nil
  then player.isholdingm2 = 0
   end
   
   if (player.cmd.buttons & BT_FIRENORMAL)
    then player.isholdingm2 = $ + 1
	 else player.isholdingm2 = 0
	  end
 
 
if (player.cmd.buttons & BT_FIRENORMAL) and player.isholdingm2 <= 1 and player.isparrying == 0
    local ring = P_SpawnPlayerMissile(player.mo, MT_PARRYTHINGIE)
          player.isparrying = 8
	end
	
	if player.isparrying == nil
	 then player.isparrying = 0
	  end
	
	if player.isparrying > 0
	 then player.isparrying = $ - 1
	     end
		 
		 if player.parried == nil
		  then player.parried = false
		   end
		 
		 if player.parried == true
		  then player.parried = false
		      S_StartSound(player.mo, sfx_parry)
			  player.powers[pw_flashing] = 16
			   end
	  
	
 end)