Hi, I am having a few problems setting a score limit for my code, I want it to pause the game automatically when the games score is reached for each player. My code is below:
var playerScore :int = 0;
var computerScore :int = 0;
if 'playerScore' :int = 10;{
//player paused the game
pauseEnabled = true;
Time.timeScale = 0;
AudioListener.volume = 0;
Screen.showCursor = true;
}
else if 'computerScore' :int = 10;{
//computer paused the game
pauseEnabled = true;
Time.timeScale = 0;
AudioListener.volume = 0;
Screen.showCursor = true;
}
function Update () {
guiText.text = "Player: " + playerScore + "
" + "Computer: " + computerScore;
}
Thanks in Advance for all help! Lenny… ![]()