Problem with getcomponent

Hello , Im having a problem with save/load , It seems like the Getcomponent aint working :confused: , Cant figure out whats wrong

var derpsave:int=0;
var derpload:int=0;
function SaveCharacter(info : String[]) //0=LEVEL | 1=EXP| 2=Name//
{
var object:GameObject;
object=GameObject.Find(info[2]);
var Playerscript=object.GetComponent("PlayerScript");
var Level : float= parseFloat(info[0]);
var Experience : float= parseFloat(info[1]);
PlayerPrefs.SetInt("Level", Level);
PlayerPrefs.SetInt("Experience",Experience);

derpsave=1;
}

function LoadCharacter(Player:String)
{

var object:GameObject;
object=GameObject.Find(Player);
var Playerscript=object.GetComponent("PlayerScript");
Playerscript.Level=PlayerPrefs.GetInt("Level");
Playerscript.Experience=PlayerPrefs.GetInt("Experience");
print (PlayerPrefs.GetString("Level"+"lol"));
print (PlayerPrefs.GetString("Experience"+"lol"));
derpload=1;
}

If i comment out everything inside the functions except Derpload / derpsave , It works

well… why dont you leavel derp’s only then?
would work fine, wouldnt it?..
chances for console output?

Ohh sorry for not telling you what they do , They are just to check if The function gets called , They dont really do anything

I don’t know that it matters, but did you try making sure your playerScript variable is declared as a PlayerScript?

var Playerscript : PlayerScript = object.GetComponent(PlayerScript);

also, as long as your PlayerScript has a filename that’s one word (good practice in my opinion) you don’t need the quotes.