Online Respawn script free for all

This is a respawn script I implemented in my game and im here giving it away to anyone that has respawning issues this works 100% you just have to implement your own timer I disabled mine for debugging purposes so enjoy this script… please do give credit to me for the code feel free to use for any purpose though.

var PlayerObject : GameObject;
var playerReplacement : GameObject;
var timer = 0;
function Update () 
{
	//Creates an array of all players in the game
	var players: GameObject[] = GameObject.FindGameObjectsWithTag("Player");  
		
		
		//Iterates through the array and find its own prefab ignoring 
                //all other players
                 //then assigns the target to the array position gameobject
		for(player in players)
		{
		if( player.networkView.isMine)
		{
			PlayerObject = player;
		}
		}
	
		if(PlayerObject == null)
		{
			
                Network.Instantiate(playerReplacement, 
                 transform.position, transform.rotation,0); 
		timer = 0;
			
		}
	
	
	
}

Thank You BoCo for your script. I will definitely give you credit. Also, check out my game on Google Play.

https://play.google.com/store/apps/details?id=com.z285SouthGames.TurrentBattle

PLEASE MAKE SURE YOUR PHONE HAS A SCREEN LENGTH OF 4.5 INCHES AND BETTER.

thanks