I have a magic missile spell that extends from the weapon system, it works correctly in single player but in multiplayer the missiles always chase the (0,0,0) of the map on clients.

My guess is that since the missiles are able to chase, they are not getting the target's location on the clients.

Code:
class MMSkillMagicMissile extends MMSkill;

	const AdjustPoint = 100;
	const GatherDist = 50; //The distance from the offset point the missile needs to get before chasing the target
	const SquareAngle = 16384;

	var Vector PointTarget[2]; //If there is no target, define two points to follow
	var float PosOffset; //A little random distance from the target
	//debug
	//var(Debug) bool bDebug; // Used to toggle debug logging

simulated function CustomFire()
{
	//The variables for the tracing
	local Vector End, PawnEyePosition, PawnEyeHitLocation, PawnEyeHitNormal, CameraHitLocation, CameraHitNormal;
	local Rotator CameraRotation;
	local TargetableObject CameraHitObject, PawnEyeHitObject;
	local Actor SeekTarget;

	//The variables for the missile position
	local Vector Offset, Pos[5], Loc, Tar[2], CamLoc;
	local Rotator Facing, ViewRot, Temp;
	local float CRadius, CHeight;
	local int i;
	local MMMagicMissile Missile;
	
	if ( Owner.Role == ROLE_Authority )
	{
		Loc = Owner.Location;
		CamLoc = MMGamePawn(Owner).GetPawnViewLocation();
		MMGamePawn(Owner).GetPawnEyesViewPoint(PawnEyePosition, CameraRotation);
		End = CamLoc + (Vector(CameraRotation) * WeaponRange);

		CameraHitObject = TargetableObject(Owner.Trace(CameraHitLocation, CameraHitNormal, End, CamLoc, true, Vect(3,3,3)));

		//Owner.DrawDebugLine(CamLoc, End, 255, 0, 0, true);
		if (CameraHitObject != none)
		{
			PawnEyeHitObject = TargetableObject(Owner.Trace(PawnEyeHitLocation, PawnEyeHitNormal, CameraHitLocation, PawnEyeHitLocation, true, Vect(3,3,3)));

			if (IsZero(PawnEyeHitLocation) || CameraHitObject == PawnEyeHitObject)
			{
				SeekTarget = CameraHitObject;
				//`Log(CameraHitObject @ PawnEyeHitObject @ SeekTarget);
			}
		}

		Facing = Pawn(Owner).GetViewRotation();
		Facing.Pitch = 0;
		//Facing = Owner.newRotation;
		CRadius = Pawn(Owner).GetCollisionRadius();
		CHeight = Pawn(Owner).GetCollisionHeight();
		Offset = Loc - (Vector(Facing) * (CRadius / 1.5));
		ViewRot = Pawn(Owner).GetViewRotation();
		Tar[0] = CamLoc + (Vector(ViewRot) * AdjustPoint);
		Tar[1] = CamLoc + (Vector(ViewRot) * 2500);

		Temp = Facing;
		Temp.Yaw += SquareAngle;
		Pos[0] = Offset + (Vector(Temp) * CRadius);
		Temp = Facing;
		Temp.Yaw -= SquareAngle;
		Pos[1] = Offset + (Vector(Temp) * CRadius);
		Pos[2] = Pos[0] + (Vect(0, 0, 1) * (CHeight / 1.5));
		Pos[3] = Pos[1] + (Vect(0, 0, 1) * (CHeight / 1.5));
		Pos[4] = Offset + (Vect(0, 0, 1) * CHeight);
		Offset = Offset - (Vector(Facing) * (CRadius / 2)); //So the missiles do a better turn

		for(i=0; i<5; i++)
		{
			Missile = Owner.Spawn(class'MMMagicMissile', Owner, , Pos[i], Rotator(Pos[i] - Offset), , true);
			if( Missile != None && !Missile.bDeleteMe )
			{
				//Missile.InitialRelease = Loc;
				Missile.GatherDist = GatherDist;
				Missile.AdjustPoint = AdjustPoint;
				//Missile.PointTarget[0] = Tar[0];// + (VRand() * PosOffset);
				Missile.PointTarget = Tar[1];// + (VRand() * (PosOffset / 2));
				Missile.VectorTarget = Tar[0];
				Missile.SetTarget(SeekTarget, true);
				//Missile.Init(Pos[i] - Offset);
				`Log("Magic Missile incomming");
			}
		}
		
		if (bDebug)
		{
			Missile.bDebug = true;
			Owner.DrawDebugSphere(Tar[0], 25, 8, 0, 0, 255, true);
			Owner.DrawDebugSphere(Tar[1], 16, 8, 255, 0, 0, true);
		}
	}
}

DefaultProperties
{
	bDebug=false

	SkillName="Magic Missile"
	bCanChannel=true

	WeaponRange=1200
	
	maxChannelTime=3.f

	MagicCost=5
	MagicChannelCost=10
	MagicDamage=5
	MagicDamageChannel=15

	PosOffset=30.f;

	//Weapon variables
	FireInterval(0)=+1.0;
	
	WeaponFireTypes(0)=EWFT_Custom
	WeaponProjectiles(0)=class'MMMagicMissile'
	FiringStatesArray(0)=WeaponFiring
}
Code:
class MMMagicMissile extends MMProjectile;

	var Vector PointTarget; //When there is no target to follow, used to to the gather effect
	var Vector InitialRelease; //This variable represents the caster location when he fired the laser, missile
	var Float AdjustPoint; //The point where the missile needs to converge after being cast
	var Float GatherDist; //The distance from the offset point the missile needs to get before chasing the target

/**This function should be the last one to be called!*/
function Init(Vector Direction)
{
	Direction = Normal(Direction);
	Velocity = Speed * Direction;
	//if (SeekTarget != none && ((VSize(VectorTarget - InitialRelease) - GatherDist) >= VSize(SeekTarget.Location - InitialRelease)))
	//{
	//	bCanAdjust = false;
	//}
}

simulated event PostBeginPlay()
{
	if (Role == ROLE_Authority)
	{
		Velocity = Speed * Vector(Rotation);
		InitialRelease = Owner.Location;
	}

	super.PostBeginPlay();

	`Log("Magic Missile PostBeginPlay finish");
}

simulated function Tick (Float DeltaTime)
{

	if (bCanChase && SeekTarget != none)
	{
		if (KeepChasing())
		{
			TargetDirection = Rotator(SeekTarget.Location - Location);
		}else
		{
			SetTarget(SeekTarget, false);
			bCanAdjust = false;
		}
	}

	if (bCanAdjust)
	{
		if ((VSize(VectorTarget - Location) <= GatherDist) || (VSize(InitialRelease - Location) >= AdjustPoint + GatherDist))
		{
			bCanAdjust = false;
			VectorTarget = PointTarget;
			//InterpRate = 6.0;
		}
		TargetDirection = Rotator(VectorTarget - Location);
	}
	InterpRate = (100 + MaxSpeed - Speed) / 100;

	if (bDebug)
	{
		//`Log(AngleDiff @ " " @ !TargetableObject(SeekTarget).IsValidTarget());
	}

	Super.Tick(DeltaTime);
}

DefaultProperties
{
	SpeedIncrease=100.f
	MaxSpeed=800.f
	Speed=300.f

	Begin Object Name=CollisionCylinder
		CollisionRadius=+00015.000000
		CollisionHeight=+00015.000000
	End Object

	Begin Object Class=ParticleSystemComponent Name=MyParticleSystem
		Template=ParticleSystem'MagicMissile.Particles.MagicMissile_Part'//ParticleSystem'MMPackage.Particles.MagicMissile'
		bAutoActivate=true
	End Object
	Components.Add(MyParticleSystem)

	Damage=5.0

	GatherDist=50.0
	AdjustPoint=100.0
}
But I don't know how can I replicate the VectorTarget, PointTarget, GatherDist and AdjustPoint, I thought of putting on the PostBeginPlay but as soon as the missiles are spawned the function is called instead of waiting for customfire() to finish. (And I thought unreal was single-threaded).

How can I replicate those variables if as soon as I spawn the missile it is cut from the network?

Thank you very much.