Instantiate prefabs scaled

Hello Unity Community!

I have a function instantiating a prefab and I want to do another function with same instantiate but in x scale -1. I don’t know how to do it, can someone help me? Thanks.

function AttackX (){
Instantiate(attackXeffect, Vector3(playerXpos +1.2, playerYpos, playerZpos), Quaternion.identity);
transform.position += Vector3.right * 5 * Time.deltaTime;
}

function AttackXleft (){
Instantiate(attackXeffect, Vector3(playerXpos +1.2, playerYpos, playerZpos), Quaternion.identity);
transform.position -= Vector3.right * 5 * Time.deltaTime;
}

You can just change the transform.localScale after instantiating, exactly like you did with the transform.position.

transform.localScale.x = -1;