Tiny tag changing and checking problem

Hi y’all! No I’m not from Texas, fool’d ya right? Ok I’ll shush, and get to the question. xD

Anyway here’s the script. There’s two objects, CargoPad_A and CargoPad_B script. This is CargoPad_A script but its pretty much the same as B. Anyway my problem is with this one.

What its suppose to do is when the player ship lands(collides) on it, check if it collided with a object with a tag “Player”, change the player ships tag to “CargoPad_A_Loaded”, change the CargoPad’s tag to “CargoPad_A_Loaded” and give 500 score to the player(which is in another script), and thus rendering landing on the same pad twice or more, and getting score each time, not possible cause the ship is no longer tagged as “Player”. But for some reason I can’t figure out, the player gets 500 points if he lands on the same pad again even tho the tag changed, and then passes the level cause you only need 1000 points(load cargo on one pad, unload on another) to finish a level. xD

Already made a few levels with cargo pads, and I didn’t notice earlier cause I played it right, and didn’t land on the same pad twice. xD

var stationLight : Light;
var onMaterial : Material;
var onColor : Color;

var ship : GameObject;
var shipScript : PlayerController;

var GUI : InGameGUI;


function Start ()
{
	shipScript = ship.GetComponent(PlayerController);
	GUI = GameObject.FindWithTag("GUI").GetComponent(InGameGUI);
}

function OnCollisionEnter(cargoLoad : Collision)
{
	if(cargoLoad.gameObject.tag == "Player")
	{
		shipScript.LoadCargoA();
		ship.gameObject.tag = "CargoPad_A_Loaded";
    	Activate();
    }
    else if(cargoLoad.gameObject.tag == "CargoPad_A_Loaded")
    {
    	print("Already loaded...");
    }
}

function Activate()
{
	audio.Play();
	gameObject.tag = "CargoPad_A_Loaded";
	renderer.material = onMaterial;
	stationLight.color = onColor;
	GUI.LZActivated();
}

judging by your script, you never changed the cargo pad tag, just the ship:

if(cargoLoad.gameObject.tag == "Player")
{
shipScript.LoadCargoA();
ship.gameObject.tag = "CargoPad_A_Loaded";   //change this
cargoLoad.gameObject.tag = "CargoPad_A_Loaded";   // to this
Activate();
}

I fixed it. Rewrote most of the code and made new tags. Changed CargoPadA1 and CargoPadB2 to A1 and A2, cause the first was confusing me a lot. xD
Also removed the light and material lines to make it simpler for viewing.
I’ll post both A1 pad and A2 pad’s scripts if anyone needs them or had the same problems with tags. I commented on each line of A1.js to avoid future confusing when I forget how I did all that. xD

A1.js

#pragma strict

//Ship starts off with tag Player
//Cargo pad A1 starts off with tag CargoPadA1

var ship : GameObject;		//Ship we'll be accessing the code from to control the Cargo Loaded boolean.
var shipScript : PlayerController; //Ship script we'll be changing the Cargo Loaded boolean.
var GUI : InGameGUI; //GUI script we'll be using to get score from landing on CargoPadA1


function Start ()
{
	shipScript = ship.GetComponent(PlayerController);	//Get the PlayerController script from the ship
	GUI = GameObject.FindWithTag("GUI").GetComponent(InGameGUI);	//Get the InGameGUI script from the GUI object
	Debug.Log ("Connected to ShipsScript to control cargo load and to GUI for score");	//check if it reached this line
}

function OnCollisionEnter(cargoLoad : Collision)
{
	if(cargoLoad.gameObject.tag == "Player") //Our initiate ship tag
	{
		Debug.Log ("Landed on A1"); //checking if we landed
		ship.gameObject.tag = "ShipLoaded"; //changing the ships tag to ShipLoaded so we can no longer land there as Player and get points
		Debug.Log ("Changed ships tag to ShipLoaded"); //checking
		Activate(); //Getting to function Activate. Purposfuly set in the middle of the code to check if it will work and everything after it
		gameObject.tag = "CargoPadALoaded"; //changing A1's tag to CargoPadALoaded, not necessary since we already changed the ships tag, but just in case
		Debug.Log ("Changed CargoPads script to CargoPadALoaded"); //checking
		shipScript.LoadCargoA();	//Just changing the cargoLoaded boolean to true in the PlayerController script
		Debug.Log ("Cargo loaded :)"); //checking if it reached to this point
	}
	else if(cargoLoad.gameObject.tag != "Player") //if the ship is no longer tagged Player, meaning it has cargo, nothing will happen upon collision
	{
		Debug.Log ("Already Landed on A1"); //checking if nothing happened
	}
}

function Activate()
{
	audio.Play(); //playing audio to indicate that the ship has landed
	Debug.Log ("Playing audio."); 
	GUI.LZActivated(); //Giving score to the player in the InGameGUI script
}

And A2.js

#pragma strict

//Cargo pad A2 starts off with tag CargoPadA2

var ship : GameObject;
var shipScript : PlayerController;
var GUI : InGameGUI;

function Start ()
{
	shipScript = ship.GetComponent(PlayerController);
	GUI = GameObject.FindWithTag("GUI").GetComponent(InGameGUI);
}

function OnCollisionEnter(cargoLoad : Collision)
{
	if(cargoLoad.gameObject.tag == "ShipLoaded")
	{
		Debug.Log ("Landed on A2");
		ship.gameObject.tag = "Player";
		Debug.Log ("Changed ships tag to Player");
		Activate();
		gameObject.tag = "CargoPadAUnloaded";
		Debug.Log ("Changed CargoPads script to CargoPadAUnloaded");
		shipScript.UnloadCargoA();
		Debug.Log ("Cargo unloaded :D");
	}
	else if(cargoLoad.gameObject.tag != "ShipLoaded")
	{
		Debug.Log ("Go back to A1 and load the cargo first!");
	}
}

function Activate()
{
	audio.Play();
	Debug.Log ("Playing audio."); 
	GUI.LZActivated();
}