Vector3 not receiving coordinates

I have a vector3 created in one script that tells the location of the player, and a vector3
in another script that is supposed to receive it, but the receiver keeps showing up as 0,0,0.

Here is the sending script:

var pos : Vector3;

function Update () {
  pos = transform.position = Vector3(0, 0, 0);
}

and here is the receiving script:

var player : GameObject;

var looking = false;
var ply : Vector3;

var x : float;
var z : float;

function Update() {
    x = Random.Range(1, 30);
    z = Random.Range(1, 30);
    player.GetComponent(Playerpos).pos = ply;
    ply + Vector3(x, 0, z);
    
    if(looking == false){
        transform.position = ply;
    }
}

function HitByRaycast(source : GameObject) {
    looking = true;
}

EDIT:
Benprodictions1: Since you don’t seem to be capable enough to format your code yourself, I did it for you!!!

Ok, lets desc check this:

“sending script”
-every update you set both pos and player position to Vector3.zero

“receiving script”
-every update
-You set sending script: pos to a random position
-You generate a new random position but don’t assign it
-You set the position of the object of the sending script to a random position which never changes

I can’t tell what this is supposed to accomplish, but I’m sure you can tell where you went wrong :slight_smile:

Hope this helps,
Benproductions1