playerprefs problem

hello
i am working on android game
and now i am working about high score
on the first scene
i did that code

if (score > PlayerPrefs.GetFloat(“BrickScore”))
{
PlayerPrefs.SetInt(“BrickScore”,score ) ;
}

then on the game over scene
i did that script

#pragma strict
var BScore : TextMesh ;
function Start () {

}
function Awake ()
{

BScore.text = PlayerPrefs.GetInt(“BrickScor”) ;

}
function Update () {

}

so on the script there is an error say
#pragma strict
var BScore : TextMesh ;
function Start () {

}
function Awake ()
{

BScore.text = PlayerPrefs.GetInt(“BrickScor”) ;

}
function Update () {

}

and that is the error appear to me (Cannot convert ‘int’ to ‘String’.)
so it is first time to me to work on player prefs
what i did wrong here ?

BScore.text = PlayerPrefs.GetInt(“BrickScor”) ; … an e is missing at the end :slight_smile: and initially you call getfloat then getint setint. try to stay consistent by only using setint getint.

Correct: BScore.text = PlayerPrefs.GetInt(“BrickScore”).ToString() ;
Explanation: BScore.text is of type String and GetInt returns an Integer value, so you need to convert the Integer to String.

Please read what #pragma strict means, it might help you to understand better.