A little help with a orb script

Im having a bit of trouble with a script for my platform game.
The scripts (there are two) are made in Javascript, since thats the only language i know.
The scripts are supposed to turn on and off an orb at the end when you collect a certain amount of points. But the script doesnt do that. Up until now i have had help from a lot of people creating this script and i have finally managed to turn the orb offline… however, now i cant turn the orb back on.

Here are the two script:

Main “Points System” script:

//Variable for current Score

var score = 0;

//Variable for text showing score 

var scoreText = "Score: 0";

//Variable for the skin of the GUI

var mySkin : GUISkin;

//Variable for end orb

var Orb = false;

function OnTriggerEnter( other : Collider ) {

	Debug.Log("OnTriggerEnter() was called");

	if (other.tag == "Glowball") {

	    // Sets a message in the log

		Debug.Log("Other object is a glowball");

		score += 1;

		scoreText = "Score: " + score;

		//Tells log what score is

		Debug.Log("Score is now " + score);




function Update(){

	if (score >= 4){




function ActivateOrb(){

	var orb = GameObject.Find("orb");

	if (orb != null) {

		gameObject.active = true;

		Orb = true;



function OnGUI () {

	GUI.skin = mySkin;

	GUI.Label (Rect (10, 10, 500, 200), scoreText.ToString());


And here is the script for the “orb”:

function Start() {

	gameObject.active = false;


function OnTriggerEnter( other : Collider) {

	if (gameObject.active){




function YouWin(){

	//Show the win screen and results

	yield WaitForSeconds(2); //So the player can see the results



I really hope someone can help since this is the last script i need done for the gameplay.

Read through the script, it looks fine. I wouldn´t use gameObject.Find thought.