vector.right and left on same gameObject not working

Hello, I am having some issues with this script.

I have three gameObjects,

One player
one left arrow
one right arrow

The idea with the script was simple, press either arrow to move in that direction.

Unsure why its not working, I thought add a tag onto the right and left would help fix the issues. But it does nothing.

I know that this issue is coming from me giving the wrong code, Iam guessing to do with the tag part.

				if (Input.GetMouseButton (0)) {
			if (GameObject.FindGameObjectWithTag ("left")) {
						gameObject.transform.Translate (Vector3.left * speed * Time.deltaTime);
						
				}
		}
				
						if (Input.GetMouseButton (0)) {
			if (GameObject.FindGameObjectWithTag ("right")) {
						gameObject.transform.Translate (Vector3.right * speed * Time.deltaTime);
						}
				}
			}
}

The basic things I was going for was, if the player were to click either the left or right arrows then the script would detect witch one by using the tags then move accordingly.

Thank for any help

script for left arrow:

function OnMouseDown () {
var playerObject = GameObject.Find("Player");
var playerObjectscript = playerObject.gameObject.GetComponent(PlayerScriptName);
playerObjectscript.moveLeft = true; //use moveRight for right arrow
}

script for player:

public var moveLeft = false;
public var moveRight = false;
var speed = 5;
        
function Update () {
if (moveLeft == true) {
gameObject.transform.Translate (Vector3.left * speed * Time.deltaTime);
}
if (moveRight == true) {
gameObject.transform.Translate (Vector3.right * speed * Time.deltaTime);
}
}