Script error help ?

My script worked fine for like 10 minutes and then stopped working. I didn’t change it at all and i get the same error every time. Could some one please explain why my script doesn’t work?

function GetActions(){

var players = GameObject.FindGameObjectsWithTag ("Player"); // Fineds all the players in the scene
 
	for (var p : GameObject in players){ // sets p as a game object for every player in the scene
		
		var PlayerComponent : Component = p.GetComponent("Player"); // Gets the component of every player in the scene
		
		var PlayerTransform : Transform = p.GetComponent(Transform);
		
    	Debug.Log("I found " + players.Length + " players"); 
		
		if (PlayerComponent.turnEnded){ // If the current player made a move
		
			if (PlayerComponent.NextTurnMove){ // if the player moved for his turn
				
				PlayerTransform.position = PlayerComponent.nextMovingPosition; // get the position he wants to move to
				
				PlayerComponent.turnEnded = false; // allows the player to move for the next turn
			

			}
		
		
		}

		
	}

NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name)
UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name)
Turn.GetActions () (at Assets/Scripts/Turn.js:69)
Turn.Update () (at Assets/Scripts/Turn.js:29)

Try this. Put your FindGameObjectsWithTag in the start function, so it has some time to initialize. And check if it found some players, if not: print out an error “Could not find any players…”. This should work if you have a script “Player” on your players.

var players : GameObject[];

function Start() {
	players = GameObject.FindGameObjectsWithTag ("Player"); // Finds all the players in the scene
}

function GetActions() { 
	Debug.Log("I found " + players.Length + " players"); 
    
    if (players.Length != 0) {
	    for (var p : GameObject in players) { // sets p as a game object for every player in the scene
			
			// Player is a script (class) called Player?
			// You don't need the " in getcomponent if your Player script is in the same language
			// And it returns a Player-object
			var PlayerComponent : Player = p.GetComponent(Player); // Gets the component of every player in the scene
			var PlayerTransform : Transform = p.GetComponent(Transform);
			
	 		if (PlayerComponent.turnEnded) { // If the current player made a move
	
	   			if (PlayerComponent.NextTurnMove) { // if the player moved for his turn
	
	    			PlayerTransform.position = PlayerComponent.nextMovingPosition; // get the position he wants to move to
					PlayerComponent.turnEnded = false; // allows the player to move for the next turn
				}
			}
		}
	} else {
	   Debug.LogError("Could not find any players. Try to add a player to the scene.");
	}
}