GetComponent Help Urgent!

Hello guys, I hope you can help me with this. I have two scripts in C#, one of them has the variable oneVar, and I want to call this variable into my other script. My teacher helped me with these, but he showed me the code for Unity 2.6 and I’m working on 2.5 (I can´t upgrade the versions now =/ ) and I really need a way to make this work on my Unity. Here’s the code he showed me:

GameObject go = GameObject.FindWithTag("grow") as GameObject;
if (go.GetComponent<PickMeUp>().oneVar == 2)
{
	Debug.Log(go.GetComponent<PickMeUp>().oneVar);
}
PickMeUp myScript = (GameObject.FindWithTag("grow") as GameObject).GetComponent("PickMeUp");
if (myScript.oneVar == 2)
{
	Debug.Log(myScript.oneVar);
}

Try that. And if you call GetComponent and want to access more than just one thing once, store that returned object. GetComponent is very slow.

Thanks for the reply! I tried that but I got the error CS0266: Cannot Implicitly convert type ‘UnityEngine.Component’ to ‘PickMeUp’. An explicit conversion exists (Are you missing a cast?).
Any ideas? Thanks again!

My bad

GameObject myObject = GameObject.FindWithTag("grow") as GameObject;
PickMeUp myScript = myObject.GetComponent("PickMeUp") as PickMeUp;
if (myScript.oneVar == 2)
{
	Debug.Log(myScript.oneVar);
}

Thanks man! Works perfectly!