So my high score system is a little weird. I use the File.CreateText thing to do it, here is the script if you need it: (Java and its called ScoreSave)
import System.IO;
var fileName = "hs.data";
var ScoreAmount : int;
var HighScore : int;
function Start (){
HighScore = ScoreLoad.CompareScore;
ScoreAmount = GlobalScore.CurrentScore;
if (ScoreAmount >= HighScore){
var OurFile = File.CreateText(fileName);
OurFile.WriteLine (ScoreAmount);
OurFile.Close();
}
}
Also here is my script for loading the score if that is needed for explanation (java and its called ScoreLoad):
import System.IO;
var fileName = "HS.data";
var ScoreLoad : String;
var HighScoreDisplay : GameObject;
var line : String;
static var CompareScore : int;
function Start(){
var sr : StreamReader = new StreamReader(fileName);
line = sr.ReadLine();
while (line != null){
ScoreLoad = line;
line = sr.ReadLine();
}
sr.Close();
HighScoreDisplay.GetComponent.<Text>().text = "" + ScoreLoad;
CompareScore = int.Parse(ScoreLoad);
}
My question is how do I make it so in the final build, players wont just be able to go to the game files, go into the file called hs.data and change their high score to a high number aka cheat? How do I like encrypt it or lock it or make it permanently read only or something? Anything helps, thank you! Also it needs to be able to save the highscore when it gets a new one so would read only not work? Help please. Thanks.