Assets/Scripts/PlayerAttack.cs(47,1): error CS8025: Parsing error

Hello guys ! i have problem in my C# it says Assets/Scripts/PlayerAttack.cs(47,1): error CS8025: Parsing error

Here is script

using UnityEngine;
using System.Collections;

public class PlayerAttack : MonoBehaviour {
	public GameObject target;
	public float attackTimer;
	public float coolDown;

	// Use this for initialization
	void Start () {
		attackTimer = 0;
		coolDown = 2.0f;
	
	}
	
	// Update is called once per frame
	void Update () {
		if(attackTimer > 0)
			attackTimer -= Time.deltaTime;
		
		if(attackTimer < 0)
			attackTimer = 0;
		
		if(Input.GetKeyUp(KeyCode.F)) {
			if(attackTimer == 0)
			Attack();
			attackTimer = coolDown;
	
	}
}
	
	private void Attack() {
	float distance = Vector3.Distance(target.transform.position, transform.position);
		
		Vector3 dir = (target.transform.position - transform.position).normalized;
		
		float direction = Vector3.Dot(dir, transform.forward);
		
		Debug.Log(direction);
		
		if(distance < 2.5f) {
			if(direction > 0) {
		EnemyHealth eh = (EnemyHealth)target.GetComponent("EnemyHealth");
		eh.addjustCurrentHealth(-10);
	}
		}
}

you’re missing a ‘}’ at the end… the Attack() function never gets closed.

[Code ] [/ Code] tags when you paste code into the forums please, I’d also advise getting into the habit of indenting lines of code, it makes things like this obvious. I.e.

private void Attack() 
{
	float distance = Vector3.Distance(target.transform.position, transform.position);
	Vector3 dir = (target.transform.position - transform.position).normalized;
	float direction = Vector3.Dot(dir, transform.forward);
	Debug.Log(direction);
	if(distance < 2.5f) 
	{
		if(direction > 0) 
		{
		EnemyHealth eh = (EnemyHealth)target.GetComponent("EnemyHealth");
		eh.addjustCurrentHealth(-10);
		}
	}
//where is the } to close Attack()???
using UnityEngine;
using System.Collections;

public class PlayerAttack : MonoBehaviour {
	public GameObject target;
	public float attackTimer;
	public float coolDown;

	// Use this for initialization
	void Start () {
		attackTimer = 0;
		coolDown = 2.0f;
	
	}
	
	// Update is called once per frame
	void Update () {
		if(attackTimer > 0)
			attackTimer -= Time.deltaTime;
		
		if(attackTimer < 0)
			attackTimer = 0;
		
		if(Input.GetKeyUp(KeyCode.F)) {
			if(attackTimer == 0)
			Attack();
			attackTimer = coolDown;
	
	}
}
	
	private void Attack() {
	float distance = Vector3.Distance(target.transform.position, transform.position);
		
		Vector3 dir = (target.transform.position - transform.position).normalized;
		
		float direction = Vector3.Dot(dir, transform.forward);
		
		Debug.Log(direction);
		
		if(distance < 2.5f) {
			if(direction > 0) {
		EnemyHealth eh = (EnemyHealth)target.GetComponent("EnemyHealth");
		eh.addjustCurrentHealth(-10);
	}
		}
}

Problem solved by puting 2 more }} on end of script. now other problem !

Assets/Scripts/PlayerAttack.cs(4,14): error CS0101: The namespace global::' already contains a definition for PlayerAttack’